dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.48k stars 112 forks source link

Escape key not being picked up as initial input #2646

Closed dankamongmen closed 2 years ago

dankamongmen commented 2 years ago

@CyanideForBreakfast reports in https://github.com/dankamongmen/libnotcurses-sys/issues/21 that we're not picking up a bare Escape when pressed as the first input. This does not appear to be the case for me in Kitty, but he's reporting Alacritty and XTerm. Either way, let's get this investigated.

dankamongmen commented 2 years ago

Confirmed that in Alacritty, pressing Escape twice at startup only results in a single Escape.

dankamongmen commented 2 years ago

Confirmed that in Alacritty, pressing Escape twice at startup only results in a single Escape.

likewise in XTerm. bah!

dankamongmen commented 2 years ago

process_escapes() is returning -1, which is what we'd expect, since we're in a possible escape sequence...but we ought then be saying "hey i don't have any more input available, kick it upstairs".

dankamongmen commented 2 years ago

right, so under Kitty we get the encoded sequence, and thus it is a complete sequence, which we translate into Escape. no such love from other terminals.

dankamongmen commented 2 years ago

ok, I have a fix, but I'm wary of it. needs more testing.

dankamongmen commented 2 years ago

yeah that "fix" is no good; it breaks kitty, and is in any case fatuously motivated. it brings me and my family great shame.

the real fix is tied up with #2647. we need to do one loop around the i/o tree when we hit the end of a possible escape sequence, in order to make sure it isn't completed there. but if we don't get good data on it immediately, kick it upstairs.