Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the throttling mechanism for PTY input handling in the terminal process, simplifying the input flow by eliminating queuing and delayed writes. The changes directly write input to the PTY process instead of chunking and throttling writes through a queue system.
Key Changes
- Removed the
chunkInput()utility function that split large input into smaller chunks (max 50 characters) to prevent data corruption - Simplified the
input()method to write directly to the PTY process instead of using a write queue with 5ms intervals - Removed supporting infrastructure including
_writeQueue,_writeTimeout,_startWrite(), and_doWrite()methods
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/vs/platform/terminal/node/terminalProcess.ts |
Removed import of chunkInput, removed queue-related fields and methods (_writeQueue, _writeTimeout, _startWrite(), _doWrite()), and simplified input() method to write directly to PTY process |
src/vs/platform/terminal/common/terminalProcess.ts |
Removed chunkInput() utility function and related constants that were used to split large input into chunks |
Includes key change microsoft/node-pty#831 and follow up microsoft/node-pty#832 Fixes #246204 Fixes #283056
dmitrivMS
previously approved these changes
Dec 15, 2025
deepak1556
previously approved these changes
Dec 15, 2025
deepak1556
reviewed
Dec 15, 2025
deepak1556
approved these changes
Dec 15, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See microsoft/node-pty#831 for a detailed write up on the cause and solution.
Fixes #283056
Fixes #246204
cc @deepak1556
After test by pasting 50kb of data takes ~500ms - the reason that this is not instantaneous would likely require moving all writing to the fd into C++ (microsoft/node-pty#833):
After test ensure EAGAIN is correctly handled by pasting > 1kb during a shell sleep: