-
Notifications
You must be signed in to change notification settings - Fork 115
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
Key bypasses read_key() when more than one key pressed together #152
Comments
On which terminal and operating system are you experiencing this behavior? |
zshell in iTerm 2 in macos |
So my guess of what's happening is that Unfortunately that is not really solvable unless console provides an API to switch the entire terminal into raw mode. That however is quite likely platform specific and I'm not sure if that can be abstracted over in a reasonable way. It might be, but I would need to experiment with that. |
Thanks for the quick answer and review! |
The same bug on WSL2 with bash in Ubuntu |
@mitsuhiko The bug is sometimes nasty when you're playing with custom interface rendering e.g. password hidding and the real character suddenly appears somewhere in the terminal cursor. The fix could be like introducing a manual enabling/disabling the raw mode and something like |
I can confirm that this still happening. As said previously, the likely cause is this race condition. For me it happens only under a VM, in VSCode integrated terminal (so a lot of overhead!). I first noticed this when holding down the left arrow key - the OS(?) starts queueing up the key a whole lot faster the longer you hold it, and so the race condition happens quite a lot |
First of all thanks for creating this crate :)
I am having an issue that when I am using
read_key()
and press more than one character key at the same time, sometimes one of them bypasses the method and is written to the terminal.For example with the following code:
if I press
j
andk
at the same time the output is something like:Not sure if I am using it wrong or if there is an issue here.
Thanks!
The text was updated successfully, but these errors were encountered: