Don't drop Keypresses outside of readchar_linux() #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Calling
tty.setraw
makes it so that subsequent calls toread()
don't readany of the typed-but-not-read characters. Reading the code, this could be
expected since
tty.setraw
is called without explicit parameters, and thedefault for when
is
TCSAFLUSH
, which means:Indeed, changing the call to be with
TCSADRAIN
seems to solve the problem ofmissing keystrokes.
However, that solves the problem that any keystrokes that occur outside of
readchar
are dropped fully, but it does not solve the problem that they willbe echoed. (They will be echoed because they occur at a point in time that
stdin is in "cooked" or "canonical" (non-raw) mode).
See #73