Skip to content

Conversation

@anthonykim1
Copy link
Contributor

@anthonykim1 anthonykim1 commented Oct 20, 2025

Resolves: #270813

Main points from: #272369 (comment)

  • Move the chat shell integration timeout setting under move it under terminal.integrated.shellIntegration.
  • Use that setting in runCommand
  • Record the time the terminal process was ready and only apply that timeout however long after that time occurs. If the timeout is 5 seconds and the terminal has been ready for 6 seconds, there's no need to wait at all.

@anthonykim1 anthonykim1 self-assigned this Oct 20, 2025
@anthonykim1 anthonykim1 requested a review from Tyriar October 21, 2025 06:51
@anthonykim1 anthonykim1 marked this pull request as ready for review October 21, 2025 06:51
Copilot AI review requested due to automatic review settings October 21, 2025 06:51
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 unifies shell integration timeout configuration by introducing a new general terminal setting terminal.integrated.shellIntegration.timeout that replaces the chat-specific setting. The change allows this timeout to be used more broadly across terminal features, including the runCommand API.

Key Changes:

  • Adds new unified terminal.integrated.shellIntegration.timeout setting
  • Updates chat agent tools to prefer the new setting with fallback to deprecated setting
  • Modifies runCommand to use the unified timeout with adjusted wait logic based on process ready time

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/vs/platform/terminal/common/terminal.ts Adds ShellIntegrationTimeout enum value for the new unified setting
src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts Defines the new terminal.integrated.shellIntegration.timeout configuration property
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts Marks the chat-specific timeout setting as deprecated and references the new unified setting
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts Updates to prefer the new unified timeout setting with fallback to deprecated chat setting
src/vs/workbench/contrib/terminal/common/terminal.ts Adds processReadyTime property to track when terminal process becomes ready
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts Implements tracking of process ready time
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts Refactors runCommand to use unified timeout with elapsed time calculation
src/vs/workbench/contrib/terminal/browser/terminalCommands.ts Adds temporary test command for validating the runCommand timeout behavior

@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 21, 2025
@anthonykim1 anthonykim1 marked this pull request as draft October 21, 2025 16:06
@anthonykim1 anthonykim1 marked this pull request as ready for review October 22, 2025 07:09
@anthonykim1 anthonykim1 requested a review from Tyriar October 22, 2025 07:09
@anthonykim1 anthonykim1 marked this pull request as draft October 22, 2025 17:07
@anthonykim1 anthonykim1 marked this pull request as ready for review October 22, 2025 19:32
@anthonykim1 anthonykim1 requested a review from Tyriar October 22, 2025 19:32
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Red CI

@anthonykim1 anthonykim1 marked this pull request as draft October 23, 2025 16:44
@anthonykim1 anthonykim1 marked this pull request as ready for review October 23, 2025 18:11
@anthonykim1 anthonykim1 requested a review from Tyriar October 23, 2025 18:11
@Tyriar Tyriar enabled auto-merge (squash) October 24, 2025 11:53
@Tyriar Tyriar merged commit cfba06b into main Oct 24, 2025
28 checks passed
@Tyriar Tyriar deleted the anthonykim1/shellIntegrationTimeout branch October 24, 2025 12:33
anthonykim1 added a commit to microsoft/vscode-python-environments that referenced this pull request Oct 26, 2025
Resolves: microsoft/vscode#273017 

* Coming from: microsoft/vscode#272369 
* Further ensure so that pwsh command activation does not hang.
* Took the regex from:
https://github.com/microsoft/vscode/blob/e1f78f13a11e6a1f20dfacbe03f8c7b64b031ac2/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.ts#L53-L97
* Already updated distro to enable onTerminalDataWrite proposed api.

---------

Co-authored-by: Daniel Imms <[email protected]>
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use timeout setting under terminal.integrated.shellIntegration. in runCommand

4 participants