Skip to content

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

Merged
merged 9 commits into from
Aug 18, 2025
Merged

Conversation

ggqlq
Copy link
Contributor

@ggqlq ggqlq commented May 30, 2025

@ggqlq ggqlq changed the title gh-134869: Fix Ctrl+C corrupts autocomplete gh-134869: Fix Ctrl+C corrupts REPL autocomplete May 31, 2025
@@ -158,6 +158,10 @@ def maybe_run_command(statement: str) -> bool:
input_n += 1
except KeyboardInterrupt:
r = _get_reader()
r.cmpltn_menu_visible = False
Copy link
Member

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.

@picnixz
Copy link
Member

picnixz commented Aug 18, 2025

Please add a NEWS entry under the Library section (this makes me wonder whether we actually need a separate section or rename IDLE to "IDLE & REPL", though it's a separate issue)

Copy link
Member

@picnixz picnixz left a 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

@pablogsal
Copy link
Member

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.

@pablogsal
Copy link
Member

Good job @ggqlq 🚀

@pablogsal pablogsal merged commit 8750e5e into python:main Aug 18, 2025
56 checks passed
@pablogsal pablogsal added awaiting merge needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Aug 18, 2025
@miss-islington-app
Copy link

Thanks @ggqlq for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @ggqlq for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 18, 2025
(cherry picked from commit 8750e5e)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 18, 2025
(cherry picked from commit 8750e5e)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Aug 18, 2025

GH-137925 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 18, 2025
@bedevere-app
Copy link

bedevere-app bot commented Aug 18, 2025

GH-137926 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Aug 18, 2025
@bedevere-bot

This comment was marked as off-topic.

pablogsal pushed a commit that referenced this pull request Aug 18, 2025
…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>
pablogsal pushed a commit that referenced this pull request Aug 18, 2025
…137926)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants