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
Console/ConPTY key event mismatch #320
Comments
I'm not totally sure I can fix this. With VT, we can't encode input with the same fidelity as we can with When we receive that through conpty, we have to translate that somehow into |
I think the new behavior is correct, it's actually the non-PTY version that's a little odd. If you press Alt down, A down, A up, Alt up, the "A up" event will have its UnicodeChar value set to 0. Libuv seemed to assume this will always be the case, and the seemingly more correct way broke it. I opened an issue with them though, because it really is their bug that a key up generates a key down message. |
@zadjii-msft thank you for the explanation (and for the great work)! I have two follow up questions:
|
I think I can answer the first question at least. For a regular console, AFAIK, you'll need to use |
On account of it looks like the new behavior is "more correct", and we haven't heard any more complaints about this I'm tentatively closing this bug out. Thanks everyone for playing 😄 |
When running neovim under tmux, pressing Alt-(anything) inserts a doubled key - for example, Alt-a sends
^[aa
or<M-a>a
. This is due to some (flawed) libuv logic here. However, I don't remember this happening before, and noticed that the key events generated under the regular console and through tmux's ConPTY are different and in a different order - see the screen shot below.Your Windows build number: 18290
What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
The left side shows the events generated by pressing Alt-a under tmux. Release order doesn't matter; key up events are generated immediately. The right side shows pressing Alt-a under a regular console. Here, release order matters, but whether I release 'Alt' first (shown here), or 'a' first (the key up will have no UnicodeChar value), it satisfies libuv's logic.
TBH, the doubled char is a bug in libuv, but if the event messages could be made consistent it'd help avoid this kind of scenario, especially if it is in fact a change from previous behavior.
The text was updated successfully, but these errors were encountered: