fix(tui): avoid tui shutdown on unrecognized input #9289
Merged
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.
Description
This PR does 3 things:
poll
could now returnNone
even if input streams were still availableThe bug came down to:
input_options.handle_crossterm_event
returnedNone
(This makes total sense, not every terminal event requires a response from the TUI)None
was returned instead of waiting for more input or a tick eventwhile let Some(event) = poll(...)
loop would exit which triggers a TUI shut downTesting Instructions
npx create-turbo@latest
and then start up the TUIturbo dev --ui=tui
, without hittingEnter
to focus the task hitq
multiple times and you should see the TUI shut down.Use
turbo
built from this PR and try the same thing. The TUI should not shut down on the press ofq
.