Skip to content

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Dec 12, 2025

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):

Recording 2025-12-15 at 04 29 24

After test ensure EAGAIN is correctly handled by pasting > 1kb during a shell sleep:

Recording 2025-12-15 at 04 32 49

@Tyriar Tyriar added this to the December / January 2026 milestone Dec 12, 2025
@Tyriar Tyriar self-assigned this Dec 12, 2025
Copilot AI review requested due to automatic review settings December 12, 2025 15:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Tyriar Tyriar marked this pull request as ready for review December 15, 2025 12:36
@Tyriar Tyriar enabled auto-merge December 15, 2025 12:36
dmitrivMS
dmitrivMS previously approved these changes Dec 15, 2025
deepak1556
deepak1556 previously approved these changes Dec 15, 2025
@Tyriar Tyriar dismissed stale reviews from deepak1556 and dmitrivMS via 2950977 December 15, 2025 12:50
@Tyriar Tyriar merged commit f15c18e into main Dec 15, 2025
28 checks passed
@Tyriar Tyriar deleted the tyriar/283056 branch December 15, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants