Merge pull request #10391 from shanevcantwell/fix/windows-remote-terminal-command

fix: generalize Windows remote detection for terminal commands
This commit is contained in:
Dallin Romney 2026-02-11 03:12:26 -08:00 • committed by GitHub
commit b81f321f78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,15 +114,16 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
const ideInfo = await extras.ide.getIdeInfo();
const toolCallId = extras.toolCallId || "";
// When extension host runs on Windows but connects to WSL, we can't spawn
// shells directly - the platform is "win32" but commands should run in Linux.
// When the extension host runs on Windows but connects to a remote workspace
// (WSL, Dev Container, SSH, etc.), we can't spawn shells directly — the
// platform is "win32" but commands should run in the remote's Linux/macOS.
// Use ide.runCommand() instead to let VS Code handle the remote execution.
const isWindowsHostWithWslRemote =
process.platform === "win32" && ideInfo.remoteName === "wsl";
const isWindowsHostWithRemote =
process.platform === "win32" && !["", "local"].includes(ideInfo.remoteName);
if (
ENABLED_FOR_REMOTES.includes(ideInfo.remoteName) &&
!isWindowsHostWithWslRemote
!isWindowsHostWithRemote
) {
// For streaming output
if (extras.onPartialOutput) {