Skip to content

Commit bafff62

Browse files
committed
Improve handling of getch delay during import completion list building coroutine.
1 parent 0f73a44 commit bafff62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bpython/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,13 @@ def idle(caller):
18081808
global stdscr
18091809

18101810
if importcompletion.find_coroutine():
1811-
curses.ungetch('')
1811+
stdscr.nodelay(True)
1812+
try:
1813+
key = stdscr.getkey()
1814+
except curses.error:
1815+
key = ''
1816+
stdscr.nodelay(False)
1817+
curses.ungetch(key)
18121818
caller.statusbar.check()
18131819

18141820
if DO_RESIZE:

0 commit comments

Comments
 (0)