Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! fixup! fixup! fixup! gh-111201: Allow bracketed paste to work
  • Loading branch information
pablogsal committed May 7, 2024
commit 78ce02b97798fe6342797ea558bc71ccdf5f878a
2 changes: 1 addition & 1 deletion Lib/_pyrepl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def do(self) -> None:
class enable_bracketed_paste(Command):
def do(self) -> None:
self.reader.paste_mode = True

class disable_bracketed_paste(Command):
def do(self) -> None:
self.reader.paste_mode = False
Expand Down
4 changes: 2 additions & 2 deletions Lib/_pyrepl/unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def prepare(self):
self.old_sigwinch = signal.signal(signal.SIGWINCH, self.__sigwinch)
except ValueError:
pass

self.__enable_bracketed_paste()

def restore(self):
Expand Down Expand Up @@ -527,7 +527,7 @@ def clear(self):
self.__move = self.__move_tall
self.__posxy = 0, 0
self.screen = []

def __enable_bracketed_paste(self) -> None:
os.write(self.output_fd, b"\x1b[?2004h")
self.flushoutput()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ def test_paste_not_in_paste_mode(self):
reader = self.prepare_reader(events)
output = multiline_input(reader)
self.assertEqual(output, output_code)

def test_bracketed_paste(self):
"""Test that bracketed paste using \x1b[200~ and \x1b[201~ works."""
# fmt: off
Expand Down