-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-134869: Fix Ctrl+C corrupts REPL autocomplete #134929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lib/_pyrepl/simple_interact.py
Outdated
@@ -158,6 +158,10 @@ def maybe_run_command(statement: str) -> bool: | |||
input_n += 1 | |||
except KeyboardInterrupt: | |||
r = _get_reader() | |||
r.cmpltn_menu_visible = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call r.cmpltn_reset()
instead.
Please add a NEWS entry under the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me but I'm not a REPL expert so there might be some other stuff to care about. cc @pablogsal
Tested this locally and works. I cannot see anything wrong with it and as testing this is going to be very complicated I am fine to merge as is. We can add a test later if someone sees a way to test this that won't be too annoying. |
Good job @ggqlq 🚀 |
Thanks @ggqlq for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks @ggqlq for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
(cherry picked from commit 8750e5e) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
(cherry picked from commit 8750e5e) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
GH-137925 is a backport of this pull request to the 3.13 branch. |
GH-137926 is a backport of this pull request to the 3.14 branch. |
Uh oh!
There was an error while loading. Please reload this page.