You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pressing a key combo with alt, the non-alt key is duplicated. Because of some quirks in the way event messages are generated, this only appears when using libuv under a ConPTY. Probably the easiest way to see this is to start a Windows exe in tmux in WSL. I see the problem both in neovim and nodejs.
Here is a nodejs program that demonstrates the issue:
process.stdin.setEncoding('utf8');process.stdin.setRawMode(true);process.stdin.on('data',x=>{// Ctrl-C to quitif(x[0]=='\u0003'){process.exit(0);}console.log(x.length,x);});process.stdin.resume();
In a regular Windows console, or in a Linux terminal with or without a PTY, pressing for example, Alt+a will show 2 '\u001ba'. In a ConPTY however, it shows 3 '\u001baa'. This affects neovim, where a <M-*> keybinding also duplicates the key, breaking these bindings.
More info is here, including a screenshot of the difference in generated console events and the place in libuv where I think the problem is.
This C++ program will print all the generated console events, if it helps. Compile with C++17 (cl /EHsc /std:c++17 console.cpp).
The text was updated successfully, but these errors were encountered:
When releasing key with Alt pressed, the reported event has
LEFT_ALT_PRESSED state flag set. This confuses libuv, making it think
that Alt+numpad combination is used. This fixes this issue by removing
the check for state flag. Checking if VirtuakKeyCode is set to VK_MENU
is enough to detect the Alt+numpad case.
Fixes: libuv#2111
When releasing key with Alt pressed, the reported event has
LEFT_ALT_PRESSED state flag set. This confuses libuv, making it think
that Alt+numpad combination is used. This fixes this issue by removing
the check for state flag. Checking if VirtuakKeyCode is set to VK_MENU
is enough to detect the Alt+numpad case.
Fixes: libuv#2111
PR-URL: libuv#2114
Reviewed-By: Refael Ackermann <refack@gmail.com>
When pressing a key combo with alt, the non-alt key is duplicated. Because of some quirks in the way event messages are generated, this only appears when using libuv under a ConPTY. Probably the easiest way to see this is to start a Windows exe in tmux in WSL. I see the problem both in neovim and nodejs.
Here is a nodejs program that demonstrates the issue:
In a regular Windows console, or in a Linux terminal with or without a PTY, pressing for example,
Alt+a
will show2 '\u001ba'
. In a ConPTY however, it shows3 '\u001baa'
. This affects neovim, where a<M-*>
keybinding also duplicates the key, breaking these bindings.More info is here, including a screenshot of the difference in generated console events and the place in libuv where I think the problem is.
This C++ program will print all the generated console events, if it helps. Compile with C++17 (
cl /EHsc /std:c++17 console.cpp
).The text was updated successfully, but these errors were encountered: