Skip to content

Copy: selections, picker, sticky Copy; Smart Folding folds long output - #358

Draft
raiseCatError wants to merge 6 commits into
feature/command-queuefrom
feature/copy-selection
Draft

raiseCatError wants to merge 6 commits into
feature/command-queuefrom
feature/copy-selection

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Stacked on the command-queue PR. Refs #350. Part of the workflow initiative; design notes docs/design/terminal-workflow.md, ledger docs/development/workflow-initiative-ledger.md.

Copy

  • /copy and /cp: N, -N (latest N), A-B, 1,3-5, latest, ui; oldest first, overlaps once; a missing number refuses the whole copy.
  • --status / --no-status: each output followed by the status NMSh recorded for it. Default Off. Stored output never changes.
  • Settings → Copy (and /copy settings): Quick Copy / Interactive Picker, Include completion status, Auto-expand copied output. Persisted; exported/imported.
  • Interactive Picker: newest first with /copy numbers, Space/a select, / search, preview, s toggles statuses (shown before Enter).
  • Feedback is a brief note above the composer after the clipboard accepted the text.

Blocks

  • [Copy] beside [Actions] where there is room; "✓ Copied" in place without moving Actions.
  • Sticky Copy/Actions on the sticky header row while a completed block's header is scrolled away (NMSh viewport only). Captures:
Beginning Middle End Transition Next block

Folding (#350)

  • Smart folds long output (120+ lines, or as many rows when long lines wrap) whatever the command or status; up to three important lines stay visible; not collapsed under a reader who is scrolled back or selecting.
  • No copy path changes folding; Auto-expand copied output (opt-in) unfolds only the copied blocks after success.

Tests

copySelection, copyFolding, stickyControls, rewritten smartFolding, copySelectionLive (5 real-PTY tests), plus affected existing coverage; final candidate gates are recorded below.

Additive stabilization candidate — 2026-10-11

Local candidate: fd2f0e98d46d909e24c2eac5bf95e21fa3634b22. Published PR head remains 790fd740cc607cbf6e834bd01501006fa9183f82. The candidate preserves published ancestry through additive merges; final canonical verification is running and its publication/Actions gate is pending.

The macOS input canonical passed at 9465eb5. The latest Ubuntu workflow run exposed a stale Report assertion, missing VM tools, stat-only timestamp and host-installer assumptions, and a timing failure. Corrections and unchanged-threshold rerun evidence are recorded in #356 and the workflow ledger; a fresh full run is required.

Refs #356, #359. Physical terminal QA remains outstanding. The shared frontend is not frozen; no master/release merge is authorized.

…y Copy; Smart folds long output

/copy and its alias /cp:
- /copy N, /copy -N (latest N), /copy A-B, /copy 1,3-5, /copy latest, /copy ui; outputs join oldest
  first, overlaps once. A missing number refuses the whole copy; nothing is half-copied.
- --status / --no-status override "Include completion status" (Off by default) for one copy: each
  output is followed by the status NMSh recorded for it (outcome, exit code, time, waits). Stored
  output is never changed; a silent command copies its status alone only when status is asked for.
- Settings → Copy (also /copy settings): Quick Copy or Interactive Picker for a bare /copy, Include
  completion status, Auto-expand copied output. Persisted and part of settings export/import.
- Interactive Picker: newest first with /copy numbers, Space/a to select, / to search, preview of the
  highlighted output, s to toggle statuses (shown before Enter), Enter copies oldest first.
- Feedback is a brief note above the composer after the clipboard accepted the text, never a
  transcript line; mistakes in a typed /copy still answer in the transcript.

Blocks:
- A direct [Copy] beside [Actions] where the row has room; it reads "✓ Copied" in place (same
  width, Actions never moves). Copy output and Copy command + output follow the status setting;
  Copy command never does.
- While a completed block's header is scrolled away, its Copy and Actions ride on the sticky header
  row, owned by the block's startId; one set of controls on screen at a time. NMSh's viewport only:
  native terminal scrollback is not something NMSh can decorate. Captures: docs/captures/sticky-*.

Folding and copying are independent: no copy path changes what is folded. With "Auto-expand
copied output" On, only the blocks whose text was copied unfold, after a successful write.

Smart Folding: long output (120+ lines, or as many rows when long lines wrap at 120 columns) now
folds whatever the command or exit status. Before, varied diagnostics (adb getprop, ps, env) and
any output containing a single "error" word never folded. Up to three important lines from the
hidden middle (errors, compiler locations, the first frame of a trace) stay in view, and the
summary counts them. A block is never collapsed at completion while you are scrolled back or
selecting. Shorter output keeps the existing content heuristics.

This branch has not been deployed

No deployments
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