Skip to content

mecatui ask-args view: richer pretty tiers (heredoc highlight, && / || clause segmentation) #552

Open

Description

@jbeda

Summary

#488 gave the permission modal/ask-args view two tiers: a verbatim RAW tier (the wire args string, ↪-wrapped) and a PRETTY tier (Bash: decoded {"command":…} text + timeout_ms annotation). The pretty tier is deliberately shallow — no shell-aware reformatting (no mvdan/sh dependency, per ADR 0108).

Bonus ideas (from #488, separable; could be one PR each)

  • 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 the approval gate.
  • mvdan/sh-based pretty-print — normalize compound commands onto multiple lines. NOTE: ADR 0108 keeps the pretty tier byte-faithful today (no shell-aware reformatting); adopting mvdan means the pretty tier rewrites the command. The verbatim raw tier is the approval-integrity floor, so this is safe, but it is a deliberate decision, not a drive-by.

Invariant

Whatever the pretty tier does, the raw tier stays the constant floor: verbatim, untouched, one keystroke away.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementfit-and-finishtui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions