Skip to content

fix(workspace): keep the last startup log line from wrapping - #1150

Merged
EhabY merged 1 commit into
mainfrom
fix/startup-log-terminal-reflow
Oct 12, 2026
Merged

EhabY merged 1 commit into
mainfrom
fix/startup-log-terminal-reflow

Conversation

@EhabY

@EhabY EhabY commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Show Logs on the startup script warning (#1129) opens one terminal per failed script. The last log line in each terminal came out wrapped at a narrow width or cut off.

Cause

The pseudoterminal writes all the logs in open, before the terminal has its final width, so long lines wrap at a narrow width. When the panel widens, xterm.js rejoins wrapped lines, except the block that holds the cursor (reflowLargerGetLinesToRemove skips it unless reflowCursorLine is set). The logs were joined with \r\n and the last line had no line break after it, so the cursor stayed on the last log line and that line never rejoined.

Fix

End every line with \r\n, as the ping terminal in cliExec.ts already does. The cursor then sits on an empty line below the logs, so every log line can rejoin.

Validation

  • Updated the Show Logs unit test to expect the trailing line break. It failed before the fix and passes after it.
  • Opened the logs terminal in the Extension Development Host with two failed scripts. Before the fix, the last line of each terminal was wrapped at 18 columns or cut off. After it, both lines show in full.
  • pnpm typecheck, pnpm lint, and pnpm format:check pass.

The warning is unreleased, so this needs no changelog entry.

Show Logs writes the logs when the terminal opens, before it has its
final width, so lines wrap at a narrow width. xterm.js rejoins wrapped
lines when the terminal widens, except the line with the cursor. The
last log line had no line break, so it held the cursor and stayed
wrapped or cut off. End every line with a line break.
@EhabY
EhabY merged commit 53dd0ed into main Oct 12, 2026
15 checks passed
@EhabY
EhabY deleted the fix/startup-log-terminal-reflow branch October 12, 2026 20:07
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