Skip to content

Commit 829b186

Browse files
interaction works with new keys
1 parent 766fc16 commit 829b186

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bpython/curtsiesfrontend/interaction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def process_event(self, e):
6161
raise KeyboardInterrupt()
6262
elif e == "<Ctrl-d>":
6363
raise SystemExit()
64-
elif self.in_prompt and e in ("\n", "\r"):
64+
elif self.in_prompt and e in ("\n", "\r", "<Ctrl-j>", "Ctrl-m>"):
6565
line = self._current_line
6666
self.escape()
6767
self.request_greenlet.switch(line)
@@ -78,6 +78,8 @@ def process_event(self, e):
7878
self.add_normal_character(e)
7979

8080
def add_normal_character(self, e):
81+
if e == '<SPACE>': e = ' '
82+
if len(e) > 1: return
8183
self._current_line = (self._current_line[:self.cursor_offset_in_line] +
8284
e +
8385
self._current_line[self.cursor_offset_in_line:])

0 commit comments

Comments
 (0)