Skip to content
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

gh-124096: Enable REPL virtual terminal support on Windows #124119

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

y5c4l3
Copy link
Contributor

@y5c4l3 y5c4l3 commented Sep 16, 2024

Copy link

cpython-cla-bot bot commented Sep 16, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@y5c4l3 y5c4l3 force-pushed the windows-vt branch 2 times, most recently from 42a48dc to 13bb26f Compare September 19, 2024 12:31
@pablogsal
Copy link
Member

@ambv @zooba can you test this on a windows machine?

@zooba
Copy link
Member

zooba commented Sep 20, 2024

I'm just testing that indentation works when I paste code? That seems fine.

As a side note, my Ctrl+Left and Ctrl+Right shortcuts (skip word) are broken now (possibly ever since the repl went in), and there's way too much ctypes for my liking in here - we should prioritise moving those to _winapi for 3.13.1.

@y5c4l3
Copy link
Contributor Author

y5c4l3 commented Sep 20, 2024

As a side note, my Ctrl+Left and Ctrl+Right shortcuts (skip word) are broken now

It can be fixed by adding two entries in the keymap. I'll later check whether there are other sequences that I missed before and commit as soon.

@y5c4l3 y5c4l3 force-pushed the windows-vt branch 5 times, most recently from 3c1502a to 718110f Compare September 20, 2024 18:07
Signed-off-by: y5c4l3 <y5c4l3@proton.me>
To support virtual terminal mode in Windows PYREPL, we need a scanner
to read over the supported escaped VT sequences.

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Windows REPL input was using virtual key mode, which does not support
terminal escape sequences. This patch calls `SetConsoleMode` properly
when initializing and send sequences to enable bracketed-paste modes
to support verbatim copy-and-paste.

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
@y5c4l3
Copy link
Contributor Author

y5c4l3 commented Sep 28, 2024

@pablogsal @ambv @zooba
Consider it's little bit hard to integrate Windows console tests, I recorded a GIF with screenkey for reference, it at least covers:

  • Ctrl + R
  • PgUp / PgDown
  • Home / End / Ctrl + A / Ctrl + E / Ctrl + ← / Ctrl + →
  • bracketed pastes

Peek 2024-09-28 17-10

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