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
Ctrl+Arrow on the command line doesn't work under Win Terminal #19
Comments
What behavior are you seeing? |
Very interesting! It seems that is only Windows Terminal that has the problem. Regular console works. Not sure why since WT handles the same keystrokes for cmd and bash. Weird! Maybe the keystrokes are whitelisted per interpreter, because it doesn't respond to them, as if I didn't press them. But then try the next keystroke like Ctrl+E or A and it works fine. Do you happen to do anything "non-standard" in the implementation? If not I'll file a bug at WT . |
Interesting. I'm traveling right now and don't have access to WT to have a closer look. As far as non-standard, note the three shells are interacting with the console in three different ways:
|
I could file a bug on this one at WT if it helps. |
Did you end up filing a WT bug? I'm back from traveling and looking at this under a debugger the problem is indeed that the mask of control characters is different. Win32 (for whatever reason) has a flag ENHANCED_KEY which denotes a key added in the 101 key AT keyboard. I was never sure why this existed in this form, because by 1993 when NT was released, I don't think it would have supported any device with a pre-AT keyboard. But anyway, the normal arrow keys should generally have this flag set, since they're AT keys and WT is not setting that flag. The reason non-Ctrl arrows work is because I added a fallback for this case when somebody pointed out that the arrows in the number pad of their 101 key keyboard don't work, because those are the original XT, non-enhanced arrows. So I think I should continue adding these fallbacks in other code paths so that number pad arrows work the same as regular arrows, but I still think WT's Win32 translation isn't accurate in this case. Those are two different keys, and they should have two different low level key codes. (What's more funny with WT is something like "history -u", where because of this behavior the arrows don't work, and mouse doesn't work because WT doesn't have that yet, so the UI is completely useless.) |
I haven't filed it, because I hadn't heard confirmation from you. Sounds like you'd like to have two bugs, one for each project? |
It looks like Terminal already have a bug for this, it's microsoft/terminal#2397 . I just pushed a fix to support number pad arrows more consistently, so with this fix Ctrl+arrow should also work under WT whether the translation is fixed there or not. |
Thanks. ;-) |
I just released 1.21 which I believe fixes this issue. You can upgrade an existing install with |
Thanks, you're doing the lord's work, haha. Making Windows tolerable for those not interested in power shell. |
Hi, am a heavy user of skipping words on the command line via the
Ctrl+left
andCtrl+right
hotkeys.Bash/fish and cmd.exe and GUI textareas support it, although they differ slightly on the right arrow. The Unix shells go to the end of the word (rather than beginning of next) when moving to the right. Probably to be able to edit the end of the word more quickly. I don't have a strong preference here.
Hopefully Yori could support it as well.
The text was updated successfully, but these errors were encountered: