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
Hi,
I sometimes enter a search pattern (and press enter) faster than fzy starts up. I'd expect the first result to be selected in that case, but instead, the cursor moves to the second line.
I realize that this is because the code for CTRL-J is the same as '\n'. After fzy starts up, the enter key mapped to '\r', via termios.
Thus, a solution would involve:
Reading the input once, non-blockingly; preferably before the terminal is configured with termios, to avoid false conversions from CTRL-J to '\r'
Replacing all occurences of '\n' with '\r' in the early input
Feeding the converted early input into the input state machine
I'm not sure the added complexity would be justified, so perhaps take this issue as the beginning of a discussion, rather than a bug report or feature request.
The text was updated successfully, but these errors were encountered:
It's possible for user input to arrive while fzy was still reading
choices from stdin. Previously, this would happen before the correct
termios were set, causing fzy to misinterpret Enter as Ctrl-J for
example.
Fixes#81
Thanks for the report! I definitely want to fix this.
I have an alternate solution in #85, where I initialize the tty (which configures the termios) before reading in choices. (It's still technically possible that user input comes in before we initialize the tty, but I think it will probably never happen in practice)
Hi,
I sometimes enter a search pattern (and press enter) faster than fzy starts up. I'd expect the first result to be selected in that case, but instead, the cursor moves to the second line.
Test case:
I realize that this is because the code for CTRL-J is the same as '\n'. After fzy starts up, the enter key mapped to '\r', via termios.
Thus, a solution would involve:
I'm not sure the added complexity would be justified, so perhaps take this issue as the beginning of a discussion, rather than a bug report or feature request.
The text was updated successfully, but these errors were encountered: