04: Add live terminal resize handling with SIGWINCH - #163
Merged
shouze merged 1 commit intoAug 23, 2026
Conversation
shouze
force-pushed
the
feat/bun14-terminal/04-sigwinch
branch
from
August 23, 2026 15:45
9fdab01 to
9590bb7
Compare
|
Coverage after merging feat/bun14-terminal/04-sigwinch into feat/bun14-terminal/03-team-pick will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 similar comment
|
Coverage after merging feat/bun14-terminal/04-sigwinch into feat/bun14-terminal/03-team-pick will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Adds live terminal resize support to the interactive TUI by tracking terminal dimensions and triggering redraws on resize events, while centralizing exit cleanup logic.
Changes:
- Track
termHeight/termWidthand update them onSIGWINCHto trigger redraws on live terminal resizes. - Introduce an
exit()helper to consolidate cleanup and use it across multiple Ctrl+C / quit paths. - Ensure the
SIGWINCHhandler is removed on the “confirm selection” exit path.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+133
to
+134
| let termHeight = process.stdout.rows ?? 40; | ||
| let termWidth = process.stdout.columns ?? 120; |
Comment on lines
+281
to
284
| process.on("SIGWINCH", onResize); | ||
|
|
||
| for await (const chunk of process.stdin) { | ||
| const key = chunk.toString(); |
- Change const termHeight to let termHeight for runtime updates - Add let termWidth for runtime updates - Install SIGWINCH signal handler before event loop - Handler updates dimensions and triggers redraw on terminal resize - Create local exit() helper function for proper cleanup - Call process.off(SIGWINCH) in all exit paths - Ensure raw mode is disabled and terminal is cleared on exit - User can now resize window during interactive session and see immediate redraw Fixes: #144
shouze
force-pushed
the
feat/bun14-terminal/04-sigwinch
branch
from
August 23, 2026 16:05
9590bb7 to
8c7858b
Compare
|
Coverage after merging feat/bun14-terminal/04-sigwinch into feat/bun14-terminal/03-team-pick will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 similar comment
|
Coverage after merging feat/bun14-terminal/04-sigwinch into feat/bun14-terminal/03-team-pick will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
What does this PR do?
How did you verify your code works?