-
Notifications
You must be signed in to change notification settings - Fork 9k
Description
Okay so Ctrl+Alt+Space was fixed for conhost, but it looks like it's still broken in the Terminal 😢 Now it's just generating a
^@, a single NUL.I think the Terminal is synthesizing the right sequence, but maybe conpty is generating the wrong input for it now, or maybe the input that's generated by conpty doesn't get re-translated back to
^[^@correctly. I can try to keep investigating to figure out where the miscommunication is, if you need help.
@zadjii-msft Yeah I was just about to say that as well.
As I wrote above the most puzzling thing for me though is if you change this if condition (line 510) to a simple
ch != 0- which should be correct as well.
If you attach a debugger you'll see thatTerminalInputdefinitely invokes_pfnWriteEventswith a\x1b\x00sequence.
But then showkey shows a^[^Rsequence instead. How can this happen? > I don't understand how such a benign change to the if condition can cause this. 😞
Okay I maybe saw what happened here.
- On a en-us keyboard, '@' is shift+2.
- When conpty sees a
\x1b\x0, it converts it to [Shift_down, Ctrl_down, Alt_down, 2_down, 2_up, Alt_up, Ctrl_up, Shift_up].- I did not pay a ton of attention to the keys that got synthesized here. I need to re-investigate the [2_down, 2_up]
- When we get back to
TerminalInput::HandleKey, we end up skipping that branch, because thechwas0n50, which is0x32, which is'2'.
I'm not sure what's exactly the right behavior here. I'd think we probably should send a different key, but I'll need to investigate more. It's possible that the ch != 0 change would work just fine, but I want to make sure that the upstream input from conpty is actually correct.
I've got a braindead fix that would fix showkey -a, but that doesn't really resolve the issue here for Win32 applications unfortunately, so I'm gonna file a separate issue to track this investigation.
Originally posted by @zadjii-msft in #4192 (comment)