Skip to content

Prompt clip can hide a redirection target or group closer in the clipped tail #97

Open

Description

@cuihtlauac

Part of #89. Found in the review of #85 (PR #93, finding C1: #93 (review)).

Problem

After #85, every approval-prompt line is clipped to a fixed budget with a hidden-chars marker. The clip is applied to the whole rendered leaf text. A redirection suffix (> path, 2>&1, < path), the chain operator (&&, ||, |, ;), a group's ( opener and its ) closer are joined into that text before the clip, so a long argument pushes them into the clipped tail of the Steps: line. Past MAX_DISPLAY_CMD_CHARS (1024) the Command: line hides them too.

Scenario: a privileged plan

{"op":"redirect","stream":"stdout","target":{"file":"/etc/sudoers"},"body":{"op":"exec","argv":["echo","AAAA…(1100 chars)"]}}
  • Steps: line 0 shows sudo echo AAAA… [N more chars hidden]; > /etc/sudoers is cut.
  • Command: is cut at 1024 chars, before the redirection.
  • Resolves: shows only echo.

No prompt line names the target file. The marker does show that something is hidden, which is the accepted F3 trade-off of #85, but the operator cannot see what the command writes to without denying it.

Suggested direction

Clip only the command text (the argv words) and keep the structural parts (operators, parentheses, redirections and their targets) outside the budget, each bounded separately (a redirection target is a path, so it can take the field budget). This fits with Phase 1 of #89 (rendering from the compiled plan, daemon-owned syntax).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    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