anomalyco / anomalyco/opencode

[FEATURE]: Improve shell command permission request UX

Open
#38,526 1 comment 4 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Jul 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Would it be possible to improve how long shell commands are presented in permission requests?

Commands are currently displayed as uniformly colored text with basic terminal-width wrapping and they have fixed height so potentially not displayed in full.

This creates a few usability and, arguably, security issues:

It is very easy to approve the command without fully reading it.

There's no visible indication that the command was vertically truncated and not displayed in full. If the command agent wants to execute is very long and contains a dangerous operation at the end, then the user might approve it based on the visible portion without even realizing that there's more code that will be executed. This might potentially be exploited by prompt injection or a plugin if they just make bash call with a few blank lines and some dangerous command after that to ensure it is out of view and not rendered. The blank lines might trick users into thinking that the command is displayed in full leading to misinformed approval.

As a possible solution to that, I suggest that if the command is overflowing and is not displayed fully, "Approve" buttons should not be clickable or shown at all. Maybe there should be a "Scroll down" button in place of them that would scroll the command down without expanding to full screen, and once the scroll reaches down - then "Approve" buttons appear.
That would make it impossible to approve something without fully seeing it.

Complex commands are very hard to comprehend

For complex commands, this can make command boundaries, pipes, logical operators, redirects, and quoted arguments difficult to distinguish before granting permission.
The attached screenshot below shows an example of a long command that is difficult to review in its current presentation:

Image

Some possible improvements might include:

  • Shell syntax highlighting
  • More readable visual formatting or indentation
  • Improved wrapping for long commands
  • A structured view alongside the exact raw command

It would be helpful if any visual formatting preserved the command exactly as it will be executed, with the raw command still available for inspection and copying.

The permission request UI seems like the highest-priority location because readability helps users make informed security decisions. Similar presentation in completed shell tool calls could also be useful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.