Skip to content

Reflow on resize using similar logic to conpty#5321

Merged
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:5319
Mar 14, 2025
Merged

Reflow on resize using similar logic to conpty#5321
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:5319

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented Mar 14, 2025

This aligns reflowing much closer to how conpty does it. This was always an issue but only became a big issue recently because conpty 1.22+ opts to passthrough sequences rather than reprinting aggressively. This means that the conpty buffer being in sync with the xterm.js buffer is more important, otherwise the cursor will show up in a seemingly random position.

The existing reflow appears to differ somewhat in conpty, like it seems to reflow at the word level, not the character level like xterm.js, but refining that closer if not worth the effort since conpty may end up relying on the terminal's buffer in the future.

Fixes #5319
Fixes #3513
Related #4231
Related microsoft/vscode#241978


ConsoleMonitor is showing the underlying conpty buffer. See how they're mostly the same now:

Recording 2025-03-14 at 10 33 12

This aligns reflowing much closer to how conpty does it. This was always
an issue but only became a big issue recently because conpty 1.22+ opts
to passthrough sequences rather than reprinting aggressively. This means
that the conpty buffer being in sync with the xterm.js buffer is more
important, otherwise the cursor will show up in a seemingly random
position.

The existing reflow appears to differ somewhat in conpty, like it seems
to reflow at the word level, not the character level like xterm.js, but
refining that closer if not worth the effort since conpty may end up
relying on the terminal's buffer in the future[1].

Fixes xtermjs#5319
Fixes xtermjs#3513
Related xtermjs#4231
Related microsoft/vscode#241978

[1]: https://github.com/microsoft/terminal/blob/main/doc/specs/%2313000%20-%20In-process%20ConPTY.md
@Tyriar Tyriar added this to the 6.0.0 milestone Mar 14, 2025
@Tyriar Tyriar self-assigned this Mar 14, 2025
@Tyriar Tyriar enabled auto-merge March 14, 2025 17:34
@Tyriar Tyriar merged commit a260f7d into xtermjs:master Mar 14, 2025
12 checks passed
Tyriar added a commit to microsoft/vscode that referenced this pull request Mar 14, 2025
Tyriar added a commit to Tyriar/xterm.js that referenced this pull request Jun 18, 2025
This reverts commit a260f7d, reversing
changes made to 2042bb8.
Tyriar added a commit that referenced this pull request Jun 18, 2025
Revert "Merge pull request #5321 from Tyriar/5319"
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.

Resize logic does not work well with conpty v1.22+ Support alternate handling of scrollback in resize for conpty

1 participant