Skip to content

Trim buffer lines on a column shrink when reflow is disabled - #6314

Open
SeoJunLee-code wants to merge 1 commit into
xtermjs:masterfrom
SeoJunLee-code:fix/alt-buffer-shrink-trim
Open

SeoJunLee-code wants to merge 1 commit into
xtermjs:masterfrom
SeoJunLee-code:fix/alt-buffer-shrink-trim

Conversation

@SeoJunLee-code

Copy link
Copy Markdown

Fixes #6228

Summary

Buffer.resize only trimmed lines on a column shrink when reflow was enabled, so buffers with
reflow off (the alt buffer, and the normal buffer under a windowsPty without reflow support)
kept their old line length and the cells past cols. Run the existing trim outside the reflow branch.

Behavior change

With reflow off, cells cut by a shrink no longer reappear when the terminal is widened again.

Testing

  • npm run test-unit: 2448 passing, 0 failing
  • 3 new tests fail without the fix, pass with it
  • npm run lint-changes; addon-serialize unit tests: 47 passing
  • Repro from the issue on a local headless build: alt line length 20 before, 10 after

Limitations

Not tested: real full-screen apps such as vim or tmux, browser rendering, Playwright, macOS, Linux.

🤖 Generated with Claude Code

The trim only ran inside the reflow branch, so buffers with reflow off,
such as the alt buffer, kept their old line length and the cells past
cols.

Fixes xtermjs#6228

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Alt buffer lines keep their old length after a column shrink

1 participant