Skip to content

fix(tui): refresh screen correctly after Ctrl+Z resume#16326

Open
Piping wants to merge 1 commit intoanomalyco:devfrom
Piping:fix/tui-ctrlz-resume-refresh
Open

fix(tui): refresh screen correctly after Ctrl+Z resume#16326
Piping wants to merge 1 commit intoanomalyco:devfrom
Piping:fix/tui-ctrlz-resume-refresh

Conversation

@Piping
Copy link

@Piping Piping commented Mar 6, 2026

Issue for this PR

Closes #16327

Type of change

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

What does this PR do?

When opencode is suspended with Ctrl+Z, resized in the shell, and resumed with fg, the TUI could return with stale/misaligned characters because resize handling did not reliably run through the renderer's signal path.

This change makes resume explicitly trigger SIGWINCH (which @opentui/core listens to) and then performs staged repaint passes after resume. In practice this ensures terminal size is reconciled before final draw and removes the broken frame artifacts.

How did you verify your code works?

  • Reproduced locally before fix:
    1. Open TUI
    2. Press Ctrl+Z
    3. Resize terminal
    4. fg
    5. Observe incomplete redraw / artifacts
  • Verified locally after fix with the same steps: screen redraw is complete and stable.
  • Push hook also ran workspace typecheck successfully.

Screenshots / recordings

Not attached (terminal-only behavior). I can add a short recording if needed.

Checklist

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

Ensure TUI redraws correctly after suspend/resume when terminal size changes. Trigger SIGWINCH on resume and perform staged repaint passes to avoid stale buffer artifacts.
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@Piping Piping changed the title fix(tui): refresh after Ctrl+Z resume + resize fix(tui): refresh screen correctly after Ctrl+Z resume Mar 6, 2026
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI does not fully repaint after Ctrl+Z + fg when terminal is resized

1 participant