Skip to content

mecatui: permission modal does not wrap long tool args (Bash commands run off the card) #488

Closed

Description

@jbeda

Summary

The command-approval modal is nearly useless for long Bash commands: the args region is rendered with prettyJSON — indented JSON with NO width wrapping — so a long one-line command runs off the card edge. There is no scrolling either; the operator cannot read what they are approving.

Grounding

  • renderPermissionModal (cmd/mecatui/ui/permission.go:67) falls back to prettyJSON(ask.Args) (cmd/mecatui/ui/render.go:2349) for anything that is not an Edit/Write diff.
  • The plan-review path already solved this exact problem: openPlanReviewView (cmd/mecatui/ui/permission.go:151) renders the full plan into a dedicated, width-wrapped, scrollable viewport with a pinned action bar (planReviewFooterHeight).

Proposed fix

Give the permission modal the same treatment as plan review: a scrollable, width-wrapped subview for the args region so long commands are fully readable at the gate.

Bonus ideas (each separable, its own PR)

  • Heredoc language detection — a Bash command embedding <<'PY' / <<'EOF' bodies could detect the embedded language (python, bash, …) and syntax-highlight it via the existing glamour/chroma stack.
  • && / || clause segmentation — multi-clause Bash commands could render each clause visually distinct (separator glyphs / alternating styling) so compound commands are scannable at a glance.

Activity

  1. added
    enhancement
    tui
    fit-and-finish
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfit-and-finishtui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions