Skip to content

FEATURE: TUI permission prompt - configurable default height and expanded state #28191

Open

Description

@coyc

Feature Request

What

Add configuration options in tui.json to control the permission/approval prompt panel at the bottom of the TUI session view.

Why

The permission prompt panel is hard-coded to maxHeight: 15 lines and always starts collapsed (expanded: false). When a large diff is shown for approval, 15 lines is often too small to see the content clearly. Users must manually press Ctrl+F to expand it every time.

Proposed Configuration

{
  "permission_prompt": {
    "default_expanded": true,  # Always open the approval panel in fullscreen mode
    "max_height": 30              # Custom height when not expanded (default: 15)
  }
}

Current Code (for reference)

  • File: packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx
  • maxHeight: 15 hardcoded in the Prompt component
  • expanded: false hardcoded in the store initial state
  • Fullscreen toggle keybind: ctrl+f (permission.prompt.fullscreen)

Activity

  1. github-actions commented on May 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    For keybind-related issues (you mentioned ctrl+f / permission.prompt.fullscreen), please also check our pinned keybinds documentation: #4997

  2. simonklee commented on May 19, 2026

    @simonklee
    Member

    Can you explore if it's possible to add this with a plugin? Maybe not exactly as you proposed, but just in general. So I don't think we are going to change to defaults or add more complexity to this if we can avoid it.

  3. coyc commented on May 19, 2026

    @coyc
    Author

    @simonklee I dug deeper into the TUI plugin API as you suggested — here's what I found.
    Short version: TUI plugins can't modify the permission prompt either.
    Why — the full picture
    I traced every potential path in TuiPluginApi (api.tsx (https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/cli/cmd/tui/plugin/api.tsx)):

    • api.state — read-only snapshot of session/permission data
    • api.ui.dialog — replace/setSize work, but PermissionPrompt is not a dialog, it's an inline component in the session layout
    • api.slots.register — no slots in PermissionPrompt
    • api.event.on — read-only events
    • api.renderer — no component tree traversal API
    • api.command/api.kv/api.theme — irrelevant

    The root cause is in permission.tsx


    const [store, setStore] = createStore({
        expanded: false,  // hardcoded: can't start expanded
    });
    // ...
    maxHeight: 15,      // hardcoded: can't be taller
    

    This is local Solid.js state inside a component. No plugin API — server or TUI — can reach into it.

  4. coyc commented on May 19, 2026

    @coyc
    Author

    Here's how the prompt panel looks right now (default height). Only ~8 lines of diff are visible — you can't see what the agent is actually changing.
    Image

    So every single time you have to press Ctrl+F to expand and review the diff. It breaks the flow.

  5. coyc commented on May 21, 2026

    @coyc
    Author

    @simonklee I looked into making this a simple config option instead. The change is surprisingly small — just ~6 lines across 3 files, following the exact same pattern as existing options like diff_style or scroll_speed:

    Changes

    1. packages/opencode/src/cli/cmd/tui/config/tui-schema.ts — add schema field (~2 lines):
    permission_max_height: Schema.optional(
      Schema.Int.pipe(Schema.between(10, 99)).annotate({
        description: "Max height of the permission prompt in rows (10-99)"
      })
    ),
    
    1. packages/opencode/src/cli/cmd/tui/config/tui.ts — add to Resolved type + default (~3 lines):
    // In Resolved type:
    permission_max_height: number
    // In loadState result:
    permission_max_height: acc.result.permission_max_height ?? 15,
    
    1. packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx — use config instead of hardcoded value (1 line):
    // Was:
    maxHeight: 15,
    // Became:
    maxHeight: tuiConfig.permission_max_height ?? 15,
    

    Why it's low-risk

    • Default is still 15 — zero behavior change for existing users
    • Range 10-99 prevents absurd values
    • Uses the same Schema.Int.pipe(Schema.between(...)) validation pattern as other TUI config fields
    • No new dependencies, no refactoring

    Usage
    Users simply add to ~/.config/opencode/tui.json or .opencode/tui.json:

    {
      "permission_max_height": 40
    }
    

    Would a PR be welcome? I'm happy to open one if this approach looks good.

  6. simonklee commented on Jun 24, 2026

    @simonklee
    Member

    If you're still interested in this y ou can make a pr and i'll have a look. I'm on the fence since i think its a bit too niche, but open to it if its a minimal change.

  7. coyc commented on Jun 27, 2026

    @coyc
    Author

    Hi @simonklee ,
    here is my PR: #34208
    Tested locally, type checking passes.
    Thanks!

  8. coyc commented on Jul 28, 2026

    @coyc
    Author

    My PR was automatically closed due to the expiration.

    If someone needs to increase the height of the prompt in Opencode, then here is a patch:
    https://github.com/coyc/opencode-patches

  9. AliAltivate commented on Aug 11, 2026

    @AliAltivate

    I'd like to work on this. Plan: add a permission_height option to tui.json following the same pattern as existing options like diff_style, wired into the permission prompt panel, with the current behavior as the default. Happy to keep it minimal.

  10. AliAltivate commented on Aug 12, 2026

    @AliAltivate

    Implemented in PR #41978. Adds permission_prompt.max_height (default 15) and permission_prompt.default_expanded (default false) to tui.json, following the existing config schema patterns. Backward-compatible — behavior unchanged unless opted in.

  11. alko89 commented on Sep 21, 2026

    @alko89

    @AliAltivate why was this closed? I would also like this feature.

  12. alko89 commented on Oct 7, 2026

    @alko89

    Created a PR #53719 that addresses this, based on @AliAltivate work

  13. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Thanks for the request, @coyc! You're asking for tui.json options for the permission prompt: one to set its height when collapsed (fixed at 15 lines right now) and one to open it in fullscreen by default, so you don't have to press the fullscreen toggle (ctrl+f) every time a large diff comes up for approval.

    I checked the current v2 code (packages/tui/src/routes/session/permission.tsx). Both values are still hard-coded there, and the TUI config has no setting for them. A plugin can't change this either, because plugins have no way to adjust the built-in permission prompt.

    Maintainers will consider this as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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