]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137925)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 18 Aug 2025 21:21:26 +0000 (23:21 +0200)
committerGitHub <noreply@github.com>
Mon, 18 Aug 2025 21:21:26 +0000 (22:21 +0100)
gh-134869: Fix Ctrl+C corrupts REPL  autocomplete (GH-134929)
(cherry picked from commit 8750e5ecfcfbc337efb511046d34f28b2d26bd68)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
Lib/_pyrepl/simple_interact.py
Misc/NEWS.d/next/Library/2025-08-18-16-02-51.gh-issue-134869.GnAjnU.rst [new file with mode: 0644]

index e686526870e364e26146cd08ee405fe4bdd22861..8fb2359fb51e8a8d9ae5a4f5b0331b986287f7da 100644 (file)
@@ -156,6 +156,7 @@ def run_multiline_interactive_console(
             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 (file)
index 0000000..abb3579
--- /dev/null
@@ -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.