Skip to content

Permission dialog approve button pushed off-screen and unclickable when shell command content is too long #40968

Description

@WHAT-BUG

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

  1. In OpenCode desktop, trigger an action that requires shell command permission, such as a git add of many files followed by a git commit with a long multi-line -m "$(cat <<'EOF' ... EOF)" commit message.
  2. The permission dialog appears showing the full command text.
  3. 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 standalone cat <<'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.

Image

Environment

  • OpenCode desktop
  • macOS
  • OpenCode version: 1.18.13 (reproduced on 1.18.14 — the issue persists after updating to the latest version)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions