X Tutup
Skip to content

Commit f8ad90e

Browse files
escape support since curtsies supports it now
1 parent cdaf903 commit f8ad90e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bpython/curtsiesfrontend/interaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def process_event(self, e):
7171
else:
7272
self.request_greenlet.switch(False)
7373
self.escape()
74-
elif e in ['\x1b', '\t', '\x1b\t', '\x1b\x1b']:
74+
elif e in ['\x1b']:
7575
self.request_greenlet.switch(False)
7676
self.escape()
7777
else: # add normal character
@@ -120,7 +120,7 @@ def confirm(self, q):
120120
def file_prompt(self, s):
121121
"""Expected to return a file name, given """
122122
self.request_greenlet = greenlet.getcurrent()
123-
self.prompt = s.replace('Esc', 'Tab')
123+
self.prompt = s
124124
self.in_prompt = True
125125
result = self.main_greenlet.switch(s)
126126
return result

bpython/curtsiesfrontend/repl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def process_event(self, e):
6262
self.current_line = ''
6363
self.cursor_offset_in_line = 0
6464
self.repl.run_code_and_maybe_finish()
65+
elif e in ["\x1b"]: #ESC
66+
pass
6567
else: # add normal character
6668
self.add_normal_character(e)
6769

@@ -337,6 +339,8 @@ def process_event(self, e):
337339
#TODO add PAD keys hack as in bpython.cli
338340
elif e in ["\x18"]:
339341
self.send_current_block_to_external_editor()
342+
elif e in ["\x1b"]: #ESC
343+
pass
340344
else:
341345
self.add_normal_character(e if len(e) == 1 else e[-1]) #strip control seq
342346
self.update_completion()

0 commit comments

Comments
 (0)
X Tutup