Skip to content

Commit 8b71e41

Browse files
author
Bob Farrell
committed
Escape key handling fix
Ben Ford pointed out that the escape key can cause things to go a little awry, I've fixed that and added another fix for potential breakage that hadn't come up before. committer: Bob Farrell <bob@keys.(none)>
1 parent 5990b35 commit 8b71e41

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎CHANGELOG‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v0.4.1
2+
======
3+
It looks like the last release was actually pretty bug-free, aside
4+
from one tiny bug that NEVER ACTUALLY HAPPENS but someone was bugging
5+
me about it anyway, oh well.
6+
17
v0.4.0
28
======
39
It's been quite a long time since the last update, due to several

‎bpython.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# bpython 0.4.0::fancy curses interface to the Python repl::Bob Farrell 2008
2+
# bpython 0.4.2::fancy curses interface to the Python repl::Bob Farrell 2008
33
#
44
# The MIT License
55
#
@@ -819,6 +819,9 @@ def bs( self ):
819819

820820
y, x = self.scr.getyx()
821821

822+
if not self.s:
823+
return
824+
822825
if x == self.ix and y == self.iy:
823826
return
824827

@@ -864,6 +867,8 @@ def p_key( self ):
864867
self.clrtobol()
865868
self.c = '\n'
866869
# Don't return; let it get handled
870+
if self.c == chr( 27 ):
871+
return ''
867872

868873
if self.c in ( chr(127), 'KEY_BACKSPACE' ):
869874
self.bs()

0 commit comments

Comments
 (0)