Skip to content

feat(workbench): Shell details wrap on the desktop, with output a step dimmer - #6883

Merged
M4n5ter merged 5 commits into
rust-previewfrom
feat/shell-details-layout
Nov 14, 2026
Merged

M4n5ter merged 5 commits into
rust-previewfrom
feat/shell-details-layout

Conversation

@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor

Stacked on #6868 (it builds on the pieces CodeText there). The first two commits are #6868; this PR is the last two. I'll rebase once #6868 merges.

Why

As proposed in #6078: on the desktop, a long Shell command scrolls sideways, so most of it is out of view, and the command and its output look the same, so it is hard to see where one ends and the other starts.

Change (desktop only; the terminal is unchanged)

  • The command wraps instead of scrolling sideways. Its copy button sits beside its first line.
  • stdout and stderr wrap too (separate commit, so it is easy to drop if you prefer them scrolling). Wrapped lines are budgeted in rows, so a piece still stays under the 16384 px layer limit from fix(workbench): show long tool output on macOS #6868. Scrollback, the screen and the alternate screen keep their columns: they are terminal grid rows already split at the PTY width, and wrapping them again would break their layout.
  • The output is one step dimmer than the command (C.secondary), so the two read as separate parts. A slightly wider gap sits between them.
  • The caption keeps "Shell ·", and a long working folder is shortened from its start, so its last folders stay in view.

Differences from what I proposed in #6078

  • I proposed showing the home folder as ~. I left that out: the UI does not know the home folder of the host that ran the command, and a guess could show a wrong path. Shortening from the start keeps the useful end of the path without guessing. If a real home-folder value becomes available to the UI, ~ can follow.
  • I proposed keeping the last two folders of a long path. Shortening from the start does this by width instead of by count, so it uses whatever room there is.

#6840 and #6838 are kept as they are.

AI use

Written with Claude Code (Claude Opus 5.5). It wrote the change and the tests for wrapped pieces. I checked it with a local screenshot probe in light, dark and a 900 px wide window: the command and output wrap, the copy buttons sit at the first line, and the folder is shortened from the start while "Shell ·" stays.

macOS draws each NSH text into one Core Animation layer, and a layer
taller or wider than 16384 pixels shows nothing. A Shell output of about
1200 lines rendered as an empty box at 2x.

Code text is now laid out in pieces of 200 lines, each well under the
limit. A line wider than 800 columns, with wide characters counted as
two, is cut and ends with how many characters are left. The copy buttons
still copy the whole recorded text.
…note

At the 130% text size on a 2x display, 800 columns of monospace code
text measured about 16,715 px, over the 16,384 px layer limit, and the
"more characters" note added more. The budget is now 720 columns with
the note included, and emoji and symbols such as ✅, which measure 2.2
columns, count as three. A test ties the budget to the largest size in
appearance.ts.
…, output a step dimmer

- On desktop the command wraps at the column instead of scrolling
  sideways, and its copy button stands beside its first line.
- The working folder is cut from its start when it does not fit, so its
  last folders stay in view.
- What the command printed reads one step dimmer than the command
  (the secondary text color), with a wider gap above it.
- Code text pieces count the rows a wrapped line takes at a narrow column,
  so wrapped output stays under the macOS layer limit too.
Text from pipes has no width of its own, so on desktop it wraps at the
column like the command. Terminal scrollback, the terminal screen and the
last alternate screen are rows of a fixed-width terminal grid; they keep
their columns and scroll sideways.
Integrate the merged long-text pieces fix, measure the wrapped text container, and budget for word breaks when splitting and truncating recorded Shell text. Preserve full copy text and PTY grids.

Validated with eight code-piece tests, the actual ToolReader bundle, focused types, and CoreText layout at four widths with the largest supported font on a 2x display.

Generated-by: OpenAI Codex
@M4n5ter
M4n5ter merged commit 3f0efad into rust-preview Nov 14, 2026
@M4n5ter
M4n5ter deleted the feat/shell-details-layout branch November 14, 2026 02:57
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.

2 participants