Repository navigation
TUI: re-read the window size so rows never overflow a smaller window - #29
Merged
Merged
Conversation
Every row is clipped to the width Nexus believes the window has, which it only learned from SIGWINCH. When that signal is missed, the width stays stale: after shrinking a window, reply lines, the ask card and the status bar were still drawn for the old width and the terminal wrapped them (text spilling onto the next row, stray scroll-rail marks mid-screen). The TUI now re-reads the size every 500 ms with the stream's own refresh, which emits "resize" only when the size really changed, so the existing full repaint runs. The poll is unref'd and stopped on exit. Checked under a real pty: with the signal handler gone, columns stayed at 120 after the window went to 78; the refresh read 78 and fired resize.
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.
When the window shrinks and Nexus misses the resize signal, it keeps drawing every row for the old width. The terminal then wraps those rows: reply text spills onto the next line, the status bar takes two rows, and scroll-rail marks land mid-screen.
Fix: the TUI re-reads the window size every 500 ms. Node's refresh emits
resizeonly when the size really changed, which runs the existing full repaint. The poll is unref'd and cleared on exit.Verified
columnsstayed at 120 after the window went to 78. The refresh read 78 and firedresize.HOME=/tmp/nxhome-full npm test: all suites pass, including a new regression test.