anomalyco / anomalyco/opencode
Permission dialog approve button pushed off-screen and unclickable when shell command content is too long
@Hona is already working on this.
Since Aug 7, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Describe the bug
In the OpenCode desktop app, when a permission/confirmation dialog is shown for a shell command (运行 shell 命令 / "Run shell command"), the full command text is rendered as the dialog body. If the command is long (e.g. a git commit with a large multi-line commit message via heredoc), the content overflows the dialog's visible area and the action buttons (approve/deny) are pushed entirely below the visible fold. The buttons cannot be seen and therefore cannot be clicked, making it impossible to approve or reject the permission request.
Additionally, the heredoc body of such commands appears to be rendered twice: once as part of the full command string (e.g. git commit -m "$(cat <<'EOF' ... EOF )") and again as a separate cat <<'EOF' ... block immediately after it, with no separator, identical content, and no second "Permission Required" header. This duplication roughly doubles the dialog's content height for heredoc commands, which amplifies the overflow problem.
To Reproduce
- In OpenCode desktop, trigger an action that requires shell command permission, such as a
git addof many files followed by agit commitwith a long multi-line-m "$(cat <<'EOF' ... EOF)"commit message. - The permission dialog appears showing the full command text.
- Observe that the dialog body is taller than the visible area and no approve/deny buttons are visible.
Expected behavior
- The approve/deny buttons should always remain visible and clickable, regardless of the length of the command content.
- Ideally the buttons should be pinned/sticky at the bottom of the dialog, with the command text in a scrollable area above them (the scrollbar should only scroll the content, not the buttons).
Actual behavior
- With long command content, the approve/deny buttons are rendered below the visible edge of the dialog and disappear entirely.
- A scrollbar appears in the text area, but the buttons sit outside the scrollable viewport, so scrolling does not bring them into view. The permission request cannot be approved or denied.
- For commands using heredocs (e.g.
git commit -m "$(cat <<'EOF' ... EOF )"), the heredoc body is displayed twice — once inline in the full command and again as a standalonecat <<'EOF' ...block with identical content — making the dialog roughly twice as tall as the command text alone. This duplicated block also does not appear inside the scrollable area with the action buttons.
Screenshots
Screenshot of the permission dialog: title "需要权限 / Permission Required", description "运行 shell 命令 / Run shell command", the long git add ... git commit command text filling the whole dialog, and no action buttons visible at the bottom.
Environment
- OpenCode desktop
- macOS
- OpenCode version: 1.18.13 (reproduced on 1.18.14 — the issue persists after updating to the latest version)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.