-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
pyrepl
on Windows: add Ctrl+← and Ctrl+→ word-skipping and other keybindings
#128388
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
Comments
Considering this is one of the reasons that I disable the new REPL entirely, it might be justifiable to treat this as a bug? I don't particularly mind not having the new REPL, which is why I haven't spent the time to try and fix it. But you could argue that it's not fit for purpose if I'm just turning the whole thing off. |
…-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. Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Pieter Eendebak <[email protected]>
To me this sounds very much like a new feature. |
I'm sure there are many of us that use Yes, please! It would be great if this fix goes into both Python 3.14.x and 3.13.x. BTW, the single code file that was edited in #128389 has the exact same code in the |
I agree it's a regression. When disabling the feature adds functionality, it's hard to call that functionality "new". |
@encukou, any chance this could get into a 3.13.x release? |
IMO, that's a question for the release manager. @Yhg1s? It might need some kind of a blanket decision, there are several more issues that might be classified as regressions. |
Yeah, I think clear regressions in user-visible behaviour in the interactive interpreter are worth considering for backport. Whether they're suitable depends on how invasive and risky the changes are. The fix for this issue seems fine to backport to me. |
…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]>
…ngs (GH-128389) (GH-130500) gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-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]>
Thank you for the fix, @paulie4! |
Feature or enhancement
Proposal:
Currently,
_pyrepl/windows_console.py
is very limited compared to_pyrepl/unix_console.py
, for example, it doesn't support theCtrl
+←
andCtrl
+→
word-skipping keybindings (see also #119248) nor any of the keybindings that use meta (i.e. Alt), e.g. tokill-word
orbackward-kill-word
.This is extra-annoying given the fact that the previous Python REPL did support Ctrl
+
←and
Ctrl+
→` word-skipping keybindings in Windows, i.e. before pyrepl was used for Python 3.13.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: