Repository navigation
feat(tui): redraw a waiting question when the pane is resized - #514
Merged
Merged
Conversation
crossterm reports SIGWINCH only from inside event::poll, which the reader reached only after a key. Block on the terminal for 100 ms at a time instead.
danczw
marked this pull request as ready for review
November 12, 2026 09:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A resize outranks a queued key in
waitand yields to an interrupt or a hangup.A key pressed in the up-to-100 ms gap before the reader notices still answers the old frame, and
SECURITY.mdsays so.Evidence
a_reader_with_nothing_typed_still_looks_for_a_resizefails:the reader never looked without a key: Timeout.After: it passes, with
a_resize_redraws_the_question_and_asks_again(show, arm, wait, show, arm, wait, clear),a_resize_that_leaves_no_room_for_the_question_aborts, and theWiretests for ordering, wake and the race between draw and arm.Reviews:
/code-review highat 5707693 found the reader never saw a real resize, fixed in d1da7d3; the stale-flag, dead-arm and drag-resize findings are declined as harmless or fail-closed./security-reviewat d1da7d3: no findings.Comment pass at a13ed3d: nothing to cut.
Not covered by a test: a real
SIGWINCHthrough crossterm, which the pty fixture cannot send.Merge Danger
Door: two-way
Blast Radius:
tui --approve callonlyReplygains a variant, recorded incrates/sandbx-tui-input/public-api.txt.The reader now wakes every 100 ms while idle.
Closes #508