-
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
Arrow Keys in vim within Git-bash stopped working. #6737
Comments
Reproduced with Windows Terminal 1.0.1811.0. |
The problem also affects |
It seems DECCKM does not always take effect, but I can't make sense of why. I made a test program that
Windows Terminal Preview 1.1.1812.0When I start a Git Bash profile in Windows Terminal Preview 1.1.1812.0, run the program there, and press the Down arrow key, it outputs:
That is, the ENABLE_VIRTUAL_TERMINAL_PROCESSING mode was originally disabled, and the Down arrow key was translated to ESC [ B. I run I run Windows Terminal 1.0.1811.0When trying the same steps in Windows Terminal 1.0.1811.0, the first difference is that the Ctrl key does not generate any INPUT_RECORD even though the console modes are the same as in Windows Terminal Preview. That can't be the cause of the problem, though. The Down arrow key is translated to ESC [ B, like in Windows Terminal Preview. After I debug After Cursor Keys Application Mode has been enabled by the test program, |
From the Terminal's perspective, For WT 1.0, here's the matrix of behaviors.
BEHAVIORS BEFORE TERMINAL 1.0
|
Okay, I'm literally seeing this behavior at the PTY:
This happens with It's quite literally disabling VT input mode only while it is changing the input configuration. If we'd ever made the console more strict ("VT input mode changes only apply when VT input mode is on"), this would break horribly. I wonder why they'd do this? |
This regressed with #6485, which was done explicitly because OpenSSH requests mouse mode when it cannot possibly receive mouse input. We cannot live in a world where we support both of these insane uses of the console API 😄 |
I totally did not expect that. If
Why doesn't Windows Terminal Preview 1.1.1812.0 have the same problem, then? 6ff8ba7 was cherry-picked from 5e2c4c6, which is included in that version. |
So, this is where it gets interesting. Windows Terminal 1.1+ was cut after #4999 landed. When that mode is engaged, it actually doesn't matter what mode terminal thinks is on at all. It just funnels raw keyboard events into the conhost backing the tab and the conhost's decision on how to encode them is "final." Instead of |
So, this is going to resolve itself for terminal when 1.1 goes stable (which is soon). It's going to become more of a problem for other terminals (alacritty, hyper, vscode, etc., even wsl-in-wsl) once this change flows up and out through Windows. Because of that, I'm going to transform this issue to match what I believe needs to be done to fix it. |
/dup #6859 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Issue
The arrow keys stopped working in vim with the latest version of the Windows Terminal. Whenever I press an arrow key, the screen flickers a blue, and nothing happens. I have to hold the control key down before the arrow keys work. Vim in git-bash worked just fine until the latest update. Vim still works in PowerShell.
Environment
Steps to reproduce
Here is my configuration for Git-Bash.
Expected behavior
The cursor should move based on the arrow key pressed.
Actual behavior
The screen flickers blue and the cursor remains in the same position.
The text was updated successfully, but these errors were encountered: