Skip to content

fix(tui): align running shell output - #41880

Merged
kitlangton merged 4 commits into
v2from
align-shell-output
Aug 12, 2026
Merged

fix(tui): align running shell output#41880
kitlangton merged 4 commits into
v2from
align-shell-output

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Keep the shell card's layout stable between the running and settled states. Two related alignment bugs:

  1. Streamed output rendered inside the spinner's text column while running, then jumped two columns left when the command completed. Port of fix(tui): align running shell output #41101, which was accidentally merged into the stale v2-migration branch and never reached v2.
  2. Wrapped command lines had the opposite problem: while running they kept a hanging indent under the command (the spinner column provides it), but on completion the $ prefix was baked into the flat text, so continuation lines jumped back to the card inset.

Before / After

Before: While a shell command ran, its multiline streamed output rendered inside the spinner's text column, indented two columns right of where it belongs. When the command completed, the output jumped two columns left while wrapped command lines jumped from a hanging indent to the card inset.

Running (output indented under the command; wrapped command aligned under the command):

before-running.png

Completed (output shifted left; wrapped command line now at the card inset):

before-completed.png

After: Nothing moves when the command settles. Output renders at the card's content inset in both states, and wrapped command lines keep the same hanging indent in both states.

Running:

after-running.png

Completed:

after-completed.png

How

Both in Shell in packages/tui/src/routes/session/index.tsx:

  • Only the command passes through Spinner; streamed output renders in its own <text> below, shared by the running and settled branches (new limitedInput / limitedOutput memos split from the existing collapsed-content memo).
  • The settled state renders the prompt ($, or {workdir}$) as its own row column mirroring the spinner's glyph-column geometry, instead of prefixing $ into the command text. input() no longer changes shape between states for the default-workdir case.

Scope

Testing

  • bun typecheck in packages/tui
  • End-to-end with opencode-drive against this branch: submitted a prompt that triggers a real multiline shell command long enough to wrap, screenshotted the running card mid-stream and after completion, and verified neither the output column nor the wrapped command indentation shifts (screenshots above; the before shots are the same script run against unpatched v2).

@kitlangton
kitlangton merged commit 5c0cc8e into v2 Aug 12, 2026
8 checks passed
@kitlangton
kitlangton deleted the align-shell-output branch August 12, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant