Reflow on resize using similar logic to conpty#5321
Merged
Tyriar merged 2 commits intoxtermjs:masterfrom Mar 14, 2025
Merged
Conversation
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
added a commit
to microsoft/vscode
that referenced
this pull request
Mar 14, 2025
Tyriar
added a commit
that referenced
this pull request
Jun 18, 2025
Revert "Merge pull request #5321 from Tyriar/5319"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: