Skip to content

fix(tui): wrap long lines in execute details - #53504

Closed
richardharnisch wants to merge 2 commits into
anomalyco:devfrom
richardharnisch:wrap-execute-lines
Closed

richardharnisch wants to merge 2 commits into
anomalyco:devfrom
richardharnisch:wrap-execute-lines

Conversation

@richardharnisch

@richardharnisch richardharnisch commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #45028. We tried to reproduce the reported clipping in write, edit, and shell-output previews, but could not reproduce it in OpenTUI native-renderer checks on Linux with default V2 settings at 80, 100, and 140 columns; those previews wrapped. The reporter's Windows Terminal/PowerShell environment was not tested. We did reproduce the long-line problem in execute details, which this PR fixes.

Type of change

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

What does this PR do?

Wrap long code and JSON lines in execute details instead of requiring horizontal scrolling. Use OpenTUI's visual-to-source line mapping to leave continuation gutters blank and keep the original line numbers. Size the dialog from rendered row counts so it also works after resizing. Copy shortcuts still use the original text.

How did you verify your code works?

  • Nine new native-renderer tests: 50/80/140-column layouts, code and JSON gutters, resize, blank lines, wide characters, tabs, streaming updates, copy, scroll, and exit. All 28 focused dialog/wrapping tests passed with the package's 30-second timeout.
  • bun typecheck in packages/tui; bun run check at the repository root; focused lint and formatting checks.
  • Full TUI suite with the pinned Bun 1.4.2: 1,463 passed, 2 skipped, 0 failed. Unchanged v2: 1,454 passed, 2 skipped, 0 failed.
  • Real terminal: verified wrapping, blank continuation gutters, correct source line numbers, resizing, copying the original code, and vertical scrolling.

Screenshots / recordings

Real-terminal screenshots with synthetic example input at two widths; no work data. Cropped to the dialog; its contents are unchanged.

Wide terminal, before:

real-before-wide

Wide terminal, after:

real-after-wide

Narrow terminal, before:

real-before-narrow

Narrow terminal, after:

real-after-narrow

Checklist

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

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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: tool-call output preview does not soft-wrap long lines

1 participant