gh-134869: Fix Ctrl+C corrupts REPL autocomplete (#134929)

This commit is contained in:
ggqlq 2025-08-19 04:54:39 +08:00 committed by GitHub
parent 5292fc00f2
commit 8750e5ecfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -158,6 +158,7 @@ def maybe_run_command(statement: str) -> bool:
input_n += 1 input_n += 1
except KeyboardInterrupt: except KeyboardInterrupt:
r = _get_reader() r = _get_reader()
r.cmpltn_reset()
if r.input_trans is r.isearch_trans: if r.input_trans is r.isearch_trans:
r.do_cmd(("isearch-end", [""])) r.do_cmd(("isearch-end", [""]))
r.pos = len(r.get_unicode()) r.pos = len(r.get_unicode())

View file

@ -0,0 +1 @@
Fix an issue where pressing Ctrl+C during tab completion in the REPL would leave the autocompletion menu in a corrupted state.