gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings#128389
gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings#128389encukou merged 10 commits into
Conversation
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
6606f63 to
283e7c3
Compare
January 1, 2025 05:57
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
Yes please, and also sign the CLA. |
Sorry, something went wrong.
|
@hugovk, UPDATE: it looks like these are the instructions for which file I should create: https://devguide.python.org/core-developers/committing/#how-to-add-a-news-entry. I think I tried signing the CLA, but the |
Sorry, something went wrong.
Yes, that's right, the Lib dir is the stdlib. |
Sorry, something went wrong.
…8.8UdMz_.rst` Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
@hugovk, thank you for that suggested doc change, which I approved. Is there anything else I need to do, or do we now just need to wait for someone else (e.g. @pablogsal, @lysnikolaou, or @ambv) to review the code changes? |
Sorry, something went wrong.
|
Thanks for the updates. Yes, someone with Windows will need to review, hopefully it shouldn't be too long :) |
Sorry, something went wrong.
eendebakpt
left a comment
There was a problem hiding this comment.
I left some comments for improvement of the code, but the PR is good: I tested with Windows 11 and the meta keybindings work now
Sorry, something went wrong.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
vstinner
left a comment
There was a problem hiding this comment.
LGTM. It works as expected: CTRL+Left skips a whole word and ALT+Backspace deletes a word.
Sorry, something went wrong.
…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 <203125+paulie4@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
…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 <203125+paulie4@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 FreeBSD14 3.13 (tier-3) has failed when building commit 4c6318e. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/1481/builds/1020 Failed tests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/test_interpreters/test_stress.py", line 30, in task
interp = interpreters.create()
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/support/interpreters/__init__.py", line 76, in create
id = _interpreters.create(reqrefs=True)
interpreters.InterpreterError: interpreter creation failed
k
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/test_interpreters/test_stress.py", line 47, in run
interp = interpreters.create()
File "/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/support/interpreters/__init__.py", line 76, in create
id = _interpreters.create(reqrefs=True)
interpreters.InterpreterError: interpreter creation failed
k
|
Sorry, something went wrong.
Fix
Lib/_pyrepl/windows_console.pyto support more keybindings, like theCtrl+←andCtrl+→word-skipping keybindings and those with meta (i.e. Alt), e.g. tokill-wordorbackward-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.
NOTE: this is my first PR for https://github.com/python/cpython, so please tell me if I need to do something else, e.g. does this need an entry added somewhere under
Misc/NEWS.d?pyreplon Windows: add Ctrl+← and Ctrl+→ word-skipping and other keybindings #128388