Skip to content

Composer: a block mixing NMSh and shell commands is reviewed, then offered one at a time (#450) - #451

Merged
raiseCatError merged 2 commits into
release/v0.22.0from
fix/v022-multiline-slash-paste
Oct 19, 2026
Merged

raiseCatError merged 2 commits into
release/v0.22.0from
fix/v022-multiline-slash-paste

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Fixes #450 (QA F02).

Change: Enter on text the shell grammar splits into several statements, one of them an NMSh command, submits and queues nothing. That covers pasted text, Ctrl+J, the idle prompt, and while a command runs. The text opens the reviewed list (Batch Review).

For a list with NMSh commands:

  • One block and Queue separately are withdrawn, since both would hand NMSh's lines to the shell.
  • One at a time puts each command in the composer, unsent, in order. Each runs only on your own Enter. The next is offered only after the previous one succeeded (as the queue pauses on a failure), and Esc stops.
  • Edit and Cancel run nothing.

Unchanged: multi-line shell text (scripts, heredocs, a quote holding a slash line), Ctrl+J for shell scripts, and a single NMSh command.

Not done, on purpose: running every pasted line automatically. A paste may hold secrets, scripts, or text meant for inspection; each command still needs its own Enter.

Tests: tests/pasteSlashCommands.test.ts covers QA's two pastes, a failure, Esc, Cancel/Edit, Ctrl+J, entering while running, and narrow widths. Six of its tests fail before the fix. The paste, batch, composer, queue, input and slash-routing suites, with pasteBatchLive and commandQueueLive: 374/374. Typecheck clean.

Physical retest: a short F02 check (both QA pastes and Esc), in Ghostty zsh; see #444.

…fered one at a time (QA F02)

Physical QA (Ghostty zsh, 68c1cbb), reproduced twice:
- Four pasted `/track …` lines gave NMSh's unknown-command error: Enter
  parsed the whole block as ONE slash command (`/track` with the other
  lines as its arguments).
- `cd modules/bun-app` + `/modules`: the cd ran, then zsh said "no such
  file or directory: /modules": a block not starting with `/` went to the
  shell whole, NMSh's line with it.
Paste Guard already labelled each line (NMSh command, navigation) and the
batch splitter separated them; nothing acted on it, and the Batch path
would have queued `/modules` for the shell too.

Enter on text the shell grammar splits into several statements, one of
them an NMSh command (pasted, typed with Ctrl+J, at the prompt or while a
command runs), now submits and queues nothing. The text opens the reviewed
list. For a list with NMSh commands, "one block" and "queue separately" are
withdrawn (both would hand NMSh's lines to the shell); "one at a time" puts
each command in the composer, unsent, in order. Each runs only on the
person's Enter, the next is offered only after the one before succeeded
(as the queue pauses on a failure), and Esc stops. Edit and Cancel run
nothing. Multi-line shell text (scripts, heredocs, quotes holding a slash
line) is unchanged, and a single NMSh command runs as before.

Tests: tests/pasteSlashCommands.test.ts (QA's two pastes, failure, Esc,
Cancel/Edit, Ctrl+J, while running, narrow widths; 6 fail before), and
the paste, batch, composer, queue, input and slash-routing suites with
pasteBatchLive and commandQueueLive: 374/374.
… (QA F02)

CI's macOS runner has no Fish, the fixture's own shell. The reviewed list
is offered only after the session's shell parse-checks each command and
fails closed when it cannot, so there the list correctly offered only Edit
and Cancel. The tests now set the session shell to zsh; they pass with
Fish absent from PATH.
@raiseCatError
raiseCatError merged commit 992277e into release/v0.22.0 Oct 19, 2026
12 checks passed
@raiseCatError

Copy link
Copy Markdown
Owner Author

Integrated into release/v0.22.0 at fa7ec665 (merge commits, in the order #448, #449, #456, #447, #451, #453, #455). Dispatched CI on that exact head: all 13 jobs green (run 39257608055).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant