Skip to content

Commit b372565

Browse files
[3.13] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137925)
gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (cherry picked from commit 8750e5e) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
1 parent d188257 commit b372565

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def maybe_run_command(statement: str) -> bool:
156156
input_n += 1
157157
except KeyboardInterrupt:
158158
r = _get_reader()
159+
r.cmpltn_reset()
159160
if r.input_trans is r.isearch_trans:
160161
r.do_cmd(("isearch-end", [""]))
161162
r.pos = len(r.get_unicode())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an issue where pressing Ctrl+C during tab completion in the REPL would leave the autocompletion menu in a corrupted state.

0 commit comments

Comments
 (0)