diff --git a/Lib/_pyrepl/simple_interact.py b/Lib/_pyrepl/simple_interact.py index e686526870e364..8fb2359fb51e8a 100644 --- a/Lib/_pyrepl/simple_interact.py +++ b/Lib/_pyrepl/simple_interact.py @@ -156,6 +156,7 @@ def maybe_run_command(statement: str) -> bool: input_n += 1 except KeyboardInterrupt: r = _get_reader() + r.cmpltn_reset() if r.input_trans is r.isearch_trans: r.do_cmd(("isearch-end", [""])) r.pos = len(r.get_unicode()) diff --git a/Misc/NEWS.d/next/Library/2025-08-18-16-02-51.gh-issue-134869.GnAjnU.rst b/Misc/NEWS.d/next/Library/2025-08-18-16-02-51.gh-issue-134869.GnAjnU.rst new file mode 100644 index 00000000000000..abb3579aa912d1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-08-18-16-02-51.gh-issue-134869.GnAjnU.rst @@ -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.