WIP: make macOS multiline PTY chunking byte-aware#300740
Closed
jcansdale wants to merge 2 commits intomicrosoft:mainfrom
Closed
WIP: make macOS multiline PTY chunking byte-aware#300740jcansdale wants to merge 2 commits intomicrosoft:mainfrom
jcansdale wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the TerminalProcess multiline write node tests to refactor command construction and add coverage for multibyte (UTF-8) payload sizing behavior relevant to macOS PTY buffering/chunking.
Changes:
- Refactors multiline command generation into reusable helpers (ASCII and multibyte variants).
- Refactors the core test runner to accept options (output file, command builder, wait timeout).
- Adds a new multibyte payload test that asserts a UTF-16 vs UTF-8 size mismatch scenario.
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @TyriarMatched files:
|
Contributor
Author
|
Builds on reverted PR. |
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.
Summary
This draft now includes both:
https://x.com/jarredsumner/status/2031651176568295779
The root cause was that the macOS multiline chunking path used JavaScript string length and string slicing, while the relevant PTY limit is in UTF-8 bytes. This PR makes the chunking gate byte-aware and splits multiline writes on UTF-8-safe byte boundaries.
A failing CI run for the multibyte regression test is here:
https://github.com/microsoft/vscode/actions/runs/22947927444/job/66604943627#step:15:21324
What Changed
data.lengthtoBuffer.byteLength(data, 'utf8')Notes