File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -636,12 +636,15 @@ def get_key(self):
636
636
if key :
637
637
return key
638
638
else :
639
- t = time .time ()
640
- self .paste_mode = (
641
- t - self .last_key_press <= self .config .paste_time
642
- )
643
- self .last_key_press = t
644
- return key
639
+ if key != '\x00 ' :
640
+ t = time .time ()
641
+ self .paste_mode = (
642
+ t - self .last_key_press <= self .config .paste_time
643
+ )
644
+ self .last_key_press = t
645
+ return key
646
+ else :
647
+ key = ''
645
648
finally :
646
649
if self .idle :
647
650
self .idle (self )
@@ -1687,7 +1690,7 @@ def sigwinch(unused_scr):
1687
1690
def sigcont (unused_scr ):
1688
1691
sigwinch (unused_scr )
1689
1692
# Forces the redraw
1690
- curses .ungetch ('' )
1693
+ curses .ungetch ('\x00 ' )
1691
1694
1692
1695
def gethw ():
1693
1696
"""I found this code on a usenet post, and snipped out the bit I needed,
@@ -1744,7 +1747,10 @@ def idle(caller):
1744
1747
caller .scr .nodelay (True )
1745
1748
key = caller .scr .getch ()
1746
1749
caller .scr .nodelay (False )
1747
- curses .ungetch (key )
1750
+ if key != - 1 :
1751
+ curses .ungetch (key )
1752
+ else :
1753
+ curses .ungetch ('\x00 ' )
1748
1754
caller .statusbar .check ()
1749
1755
caller .check ()
1750
1756
You can’t perform that action at this time.
0 commit comments