Skip to content

Commit 4e75c2a

Browse files
Clear completion list when KeyboardInterrupt occurs
Previously, the completion list would persist after a KeyboardInterrupt was triggered. This change ensures the completion state is properly reset.
1 parent 0cafa97 commit 4e75c2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ def maybe_run_command(statement: str) -> bool:
164164
r = _get_reader()
165165
if r.input_trans is r.isearch_trans:
166166
r.do_cmd(("isearch-end", [""]))
167+
if r.cmpltn_menu_choices:
168+
r.cmpltn_reset()
167169
r.pos = len(r.get_unicode())
168170
r.dirty = True
169171
r.refresh()

0 commit comments

Comments
 (0)