-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
TerminalControl does not produce ENHANCED_KEY in win32 input mode #7074
Comments
I just tried I guess that A workaround for mpv is to create an |
|
Just for the record, WT cannot update the version of conpty that comes with Windows. Alacritty is using a version of conpty that was finished almost a year ago. It's missing a bunch of our input changes. As a workaround, can you see what happens if you put the following setting at the root of your settings file? "experimental.input.forceVT": true, |
It's a laptop keyboard. It doesn't have a dedicated number pad. Numlock is not enabled.
I just installed Windows Terminal v1.0.1811.0 and it works (as it used to). Reinstalling alacritty to test. |
I didn't know that conpty was not updated by WT. Sorry about making that assumption. Is it possible to query my system to know conpty's current version and the last time it was updated?
I'll reinstall WT 1.1.2021.0 to try the suggested setting:
|
WT 1.1.2021.0 works as expected with the setting. |
I'm also quite surprised that alacritty has this problem with ConPTY. We made some input changes (#4999) between Terminal 1.0 and 1.1 that are not available to alacritty yet. You're using ConPTY 10.0.19041.0 (same as the version of Windows you're using.) Is this a Windows build of mpv? Can you point me to where you got it? If you want to help debug what is happening, can you do the following?
|
Yes, it is. From sourceforge: https://sourceforge.net/projects/mpv-player-windows/files FYI and to help other mpv users of WT: mpv-player/mpv#7944 Here you are: |
To demonstrate some difference on how applications recieve arrows input, I wrote this program: #include <stdio.h>
#include <conio.h>
int main(int argc, char **argv)
{
int c;
while ((c = getch()) != '\033' /* ESC */)
printf("'%c' 0x%02x\n", c < 32 ? '?' : c, c);
return 0;
} In windows 10 2004, in normal windows console (cmd.exe), pressing the left arrow (at the inverted T arrows cluster) produces:
While in Windows Terminal 1.1.200629002-release1.1 (command prompt - not powershell) it produces:
I'm not very familiar with scancodes (which Caveats:
Nevertheless, it does seem to suggest that there's some difference between windows console and windows terminal in how non-VT-input applications recieve arrow keypresses, and additionally with my setup I was able to reproduce the OP's issue when pressing the left arrow - mpv perceiving |
Thanks so much. This has been really helpful. This is the Terminal equivalent of #2397. There's a specific encoding bit that we were missing from the standard arrow keys. |
While I was working on the WPF control, I took a moment to refactor the message cracking out into a helper. It's a lot easier on the eyes than four lines of bit shifting repeated three times. Fixes #7074.
When we added support for win32 input mode, we neglected to pass `ENHANCED_KEY` through the two surfaces that would generate events. This broke arrow keys in much the same way was #2397, but in a different layer. While I was working on the WPF control, I took a moment to refactor the message cracking out into a helper. It's a lot easier on the eyes than four lines of bit shifting repeated three times. Fixes #7074
When we added support for win32 input mode, we neglected to pass `ENHANCED_KEY` through the two surfaces that would generate events. This broke arrow keys in much the same way was #2397, but in a different layer. While I was working on the WPF control, I took a moment to refactor the message cracking out into a helper. It's a lot easier on the eyes than four lines of bit shifting repeated three times. Fixes #7074 (cherry picked from commit dd0f7b7)
When we added support for win32 input mode, we neglected to pass `ENHANCED_KEY` through the two surfaces that would generate events. This broke arrow keys in much the same way was #2397, but in a different layer. While I was working on the WPF control, I took a moment to refactor the message cracking out into a helper. It's a lot easier on the eyes than four lines of bit shifting repeated three times. Fixes #7074 (cherry picked from commit dd0f7b7)
🎉This issue was addressed in #7106, which has now been successfully released as Handy links: |
🎉This issue was addressed in #7106, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Expected behavior
With previous Windows Terminal versions, the current position was modified as expected.
Actual behavior
LEFT, RIGHT, UP, DOWN keys not sending correct key codes:
If using powershell 7 without Windows Terminal, the arrow keys work ok. And as a reminder, it was working as expected in previous versions of Windows Terminal. Also works as expected in other shells (cmd.exe, Git Bash) without Windows Terminal.
PS:
nvim
andvim
do not have this issue. Looking for other TUI apps to verify their behavior.The text was updated successfully, but these errors were encountered: