Skip to content

Respect the user's preferred shell in agent host terminals #313160

@anthonykim1

Description

@anthonykim1

Local, remotes are more complicated than I thought, created separate follow up issues, references below in history.

Today, host-managed terminals in the agent host (the PTY-backed bash/powershell tools in copilotShellTools.ts) hardcode the shell — on Windows that's always windows pwsh (pwsh 5) regardless of what the user has set up.

If I have PowerShell 7 installed I think agent host terminal would still go to windows powershell (pwsh5)

Making the default better (well... some windows users are passionate git bash users all time) and also respecting user's preferred shell (such as the one defined in setting) would be great.
We allow user to set per OS like: "terminal.integrated.defaultProfile.windows":

  • (a) Inherit the existing integrated-terminal settings — terminal.integrated.defaultProfile.*
  • The agent host can't read workbench config directly?? because it's a separate Node process, but the workbench-side NodeAgentHostStarter already has IConfigurationService and forwards data to the child via env vars and the AHP root-config bag — same channel customizations uses today. So the workbench resolves the profile via ITerminalProfileResolverService and pushes the resolved path/args down on startup and on setting change.
  • (b) Add a dedicated agentHost.defaultShell setting. Simple and isolated, but creates a parallel surface users have to configure separately.
  • (c) Both — dedicated setting wins if explicitly set, otherwise inherit from terminal.integrated.*.

Maybe we'd have dedicated setting for agent host terminal, but if the value is not set there we'll respect user's default terminal profile setting.

Existing behavior on Copilot CLI on chat panel:

Image

Metadata

Metadata

Assignees

Labels

agent-hostIssues for the agent-host implementation (not the protocol)feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersterminalGeneral terminal issues that don't fall under another labelverification-neededVerification of issue is requested

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions