Skip to content

Readable multi-command display in action cards #1661

Backlog
1 of 2 issues completed
Backlog

Description

@smart-ssh-planner

Goal

Commands proposed by the AI (chat and MCP) that chain several independent commands on one line (a; b && c) are shown one command per line in the action card, so the user can read and review them quickly. A toggle switches back to the original single line. Display only: what is checked and executed stays the exact original command.

Scope

  • In: a read-only display layout of a command, computed in the core from the same lexer/splitter the filter engine uses; rendering of that layout in the chat action card (pending, auto-executed, executed, rejected, expired) with a toggle.
  • Out: any change to what is evaluated, confirmed or executed; reformatting inside quotes, substitutions, here-docs or bash -c scripts; breaking pipelines; the command editor ("edit then approve" keeps the raw text).

Shared decisions

  • Line breaks only at top-level ;, &&, ||, background & and existing newlines. Pipes (|, |&) never break a line (decided by maintainer).
  • The operator stays visible at the end of its line (echo a && / rm b); ; stays as well. Indentation: none.
  • No layout (show the original single line) whenever the filter parser cannot split the command safely (here-doc, complex bash -c, unbalanced quotes, control characters) or the lexer found escapes, line continuations, comments or bad substitutions – i.e. whenever the display could differ from the text the user sees in the original.
  • The layout is built from slices of the original text; concatenating the lines (with the original whitespace at the break points) gives back the original command byte for byte.
  • Toggle "formatted / original" (decided by maintainer); default formatted; the choice is remembered across cards and app restarts; shown only when the layout has more than one line. Copying the command always copies the original.
  • IPC name: command_display_layout (input: command string; output: null or a list of lines, each with its text and its trailing operator).

Sub-issues

Sub-issues

Sub-issues

1 of 2 Issues completed
Loading 2 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic

    Fields

    Priority

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions