Repository navigation
Paste batches, /ps and clipboard staging: review pasted commands and queue them together #354
Copy link
Copy link
Closed
Labels
area:executionCommand execution and lifecycleCommand execution and lifecycletype:featureNew feature or improvementNew feature or improvement
Description
Goal
Make large pasted command sequences easier to inspect and prepare without unsafe execution or a background clipboard recorder. Reuse the existing paste guard, /ps, composer, queue (#357) and copy picker (#358).
Behavior
- A large or multiline paste becomes a reviewable staging item when appropriate. Syntax-aware handling should identify independent commands only where valid for the active shell (zsh, Bash, Fish). Heredocs, loops, continuation lines, multiline strings and ambiguities remain intact; never split solely at newlines.
- Actions: Insert as text, Edit, Queue reviewed commands, Remove, Cancel. Clear count/order and individual command previews. Nothing executes just because it was pasted, staged or queued; explicit user confirmation is required to queue a reviewed batch.
/psexplicitly reads the current clipboard and brings it to paste review;/cpalias is part of Copy: selections, picker, sticky Copy; Smart Folding folds long output #358, not part of this issue.- Clipboard staging is ephemeral by default; allow deliberate user-created clips/command candidates from current composer, selected history, or safe output-derived staging. No implicit persistence across restarts, no ambient clipboard history.
- Optional clipboard-change suggestions only when a reliable platform mechanism reports changed state without reading clipboard contents, and only with NMSh owning an empty composer and no foreground input. Keep proactive suggestions configurable and unobtrusive; omit/disable when support is uncertain. Explicitly inserting opens/reads clipboard content through the sanctioned provider.
- A foreground CLI owns its input (including no-echo/password, one-key and Fish read states). Paste UI never steals, logs or replays that input.
- Preserve raw paste bytes for review (including newlines) until the user explicitly edits; no silent re-quoting, interpolation, trimming or execution.
Defaults
No automatic execution. No persistent or always-on clipboard history. No unsolicited clipboard-content inspection, network/agent transmission or panel interruption. If syntax classification is uncertain, offer a single text block.
Acceptance
- zsh/Bash/Fish shell grammar fixtures: chains, heredocs, multiline literals, escaping, comments and invalid syntax.
- Safe stage/edit/reorder/review/queue behavior with no duplicates or automatic submit.
- Clipboard missing/access denied/privacy cases, focus changes and active-program input ownership.
- Real-PTY test across narrow/NO_COLOR/Safe, detach/reattach and queue failure.
- Unobtrusive discoverable UI with existing provider fallbacks; accurate behavior when clipboard-change detection unsupported.
Parent: #359. Queue foundation: #357; copy: #358; input-awareness: #348.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:executionCommand execution and lifecycleCommand execution and lifecycletype:featureNew feature or improvementNew feature or improvement
Activity
raiseCatError commentedon Oct 10, 2026
Implemented in draft on
feature/output-references: B in Paste Review splits a pasted sequence into whole commands (zsh/Bash/Fish grammar scanner, gated by a parse-only check of each command with the real shell; ambiguous input stays one text block), reviewed with per-command classification of everything inside it, remove/reorder, Enter queues exactly the reviewed list;/psreads the clipboard once (pbpaste/wl-paste/xclip/xsel, 1 MiB, 3 s). Tests: grammar fixtures, real-shell parse checks, whole-vs-split execution differential (400 random pastes per shell), app-level, and live zsh/Bash/Fish PTY including pause on failure. Not done: clipboard-change suggestions and user-created ephemeral clips (no reliable content-free change signal here), physical QA.raiseCatError commentedon Oct 18, 2026
Paste review, B to split into whole commands, reviewed queueing and
/psship; v0.20.0 adds multi-line paste choices (Run as block, Queue separately, Edit, Cancel).Shipped in v0.20.0 through #392 (merge commit
65e4de55). v0.19.0 was never published, so this is the first release that contains it.