Skip to content

[3.13] gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-128389) #130500

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 1 commit into from
Mar 3, 2025

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 24, 2025

Fix Lib/_pyrepl/windows_console.py to support more keybindings, like the
Ctrl+ and Ctrl+ word-skipping keybindings and those with meta (i.e. Alt),
e.g. to kill-word or backward-kill-word.

Specifics: if Ctrl is pressed, emit "ctrl left" and "ctrl right" instead of just "left" or
"right," and if Meta/Alt is pressed, emit the special key code for meta before
emitting the other key that was pressed.
(cherry picked from commit 688f3a0)

Co-authored-by: Paulie Peña [email protected]
Co-authored-by: Hugo van Kemenade [email protected]
Co-authored-by: Pieter Eendebak [email protected]

…gs (pythonGH-128389)

Fix `Lib/_pyrepl/windows_console.py` to support more keybindings, like the
`Ctrl`+`←` and `Ctrl`+`→` word-skipping keybindings and those with meta (i.e. Alt),
e.g. to `kill-word` or `backward-kill-word`.

Specifics: if Ctrl is pressed, emit "ctrl left" and "ctrl right" instead of just "left" or
"right," and if Meta/Alt is pressed, emit the special key code for meta before
emitting the other key that was pressed.
(cherry picked from commit 688f3a0)

Co-authored-by: Paulie Peña <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Pieter Eendebak <[email protected]>
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally.
Thomas said in the issue that this is fine to backport.

@encukou encukou merged commit 4c6318e into python:3.13 Mar 3, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants