Skip to content

fix(tui): refresh terminal size before resize - #42330

Closed
fancive wants to merge 1 commit into
anomalyco:devfrom
fancive:fix-tui-resize
Closed

fancive wants to merge 1 commit into
anomalyco:devfrom
fancive:fix-tui-resize

Conversation

@fancive

@fancive fancive commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #42225

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenTUI reads process.stdout.columns and process.stdout.rows when handling SIGWINCH. In affected PTY hosts, Bun can leave those cached values stale until the stream refreshes its window size.

This change refreshes the TTY dimensions before OpenTUI receives the resize signal. It performs one initial refresh, installs the listener ahead of the renderer listener, and removes it when the TUI scope closes.

How did you verify your code works?

  • bun test in packages/tui: 195 passed, 1 skipped
  • bun typecheck in packages/tui
  • Manual tmux conversation resize smoke test at 68 -> 119 -> 68 columns

Screenshots / recordings

Not included. The failure is specific to live terminal resizing; the signal ordering is covered by a focused regression test and was also verified interactively in tmux.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 13, 2026
@github-actions github-actions Bot closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI does not re-layout on terminal shrink (only on grow), leaving stale width

1 participant