Skip to content

fix(tui): say how much of a long permission request is hidden - #51821

Closed
kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:fix/permission-collapsed-more-lines
Closed

kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:fix/permission-collapsed-more-lines

Conversation

@kernel-oops

@kernel-oops kernel-oops commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #51820

Type of change

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

What does this PR do?

The collapsed permission prompt is capped at 15 rows, so a long request body (usually a multi-line shell command) was clipped with no sign that anything was missing.

This adds collapsePermissionLines in util/permission.ts, which splits embedded newlines, wraps lines at the available width, and, when the result needs more rows than fit, keeps what fits and reports how many rows are hidden. The collapsed body in routes/session/permission.tsx uses it and ends with … N more lines · <fullscreen key> to view all. The fullscreen view is unchanged.

How did you verify your code works?

  • A new test in test/util/permission.test.ts for the helper covers: short bodies pass through unchanged; long and wrapped bodies are cut with the correct hidden count; embedded newlines are counted as rows.
  • bun run typecheck and the permission-related tests in packages/tui; Prettier check on the changed files.
  • Used day to day in a build of this branch: long heredoc commands now show … 109 more lines · ctrl+f to view all, and the fullscreen toggle shows the whole command.

Screenshots / recordings

Collapsed prompt ending in … 109 more lines · ctrl+f to view all after the visible part of the command.

Checklist

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y

The collapsed permission prompt is capped at 15 rows, so a long shell command
was clipped silently and the rest could only be seen by toggling fullscreen.
The collapsed body now shows what fits, wrapping long lines and splitting
embedded newlines, and ends with "… N more lines · <key> to view all".
The fullscreen view is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y
@github-actions

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

Copy link
Copy Markdown
Contributor

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

@github-actions

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: collapsed permission prompt silently clips long shell commands

1 participant