Skip to content

Terminal output not captured when Windows VS Code connects to WSL (follow-up to #9679) #9731

@shanevcantwell

Description

@shanevcantwell

Before submitting your bug report

  • I've tried using the "Ask AI" feature on the Continue docs site
  • I'm not able to find a related conversation on GitHub discussions
  • I'm not able to find an open issue that reports the same bug
  • I've seen the troubleshooting guide on the Continue Docs

Relevant environment info

Description

This is a follow-up to #9679 which fixed the spawn powershell.exe ENOENT error when Windows VS Code connects to WSL.

Background:

Current behavior:
The fix in #9679 successfully prevents the spawn error, but ide.runCommand() only sends text to VS Code's terminal via terminal.sendText() - it cannot capture output. The command executes successfully (visible in terminal), but Continue receives:

Terminal output not available. This is only available in local development environments and not in SSH environments for example.

Proposed solution:
For the isWindowsHostWithWslRemote case, instead of falling through to ide.runCommand(), spawn wsl.exe from Windows to execute commands in WSL with output capture:

if (isWindowsHostWithWslRemote) {
  // Use wsl.exe to spawn into WSL and capture output
  const shell = "wsl.exe";
  const args = ["-e", "bash", "-l", "-c", command];
  // ... rest of spawn logic with output capture
}

This allows the Windows extension host to execute commands in WSL while still capturing stdout/stderr.

To reproduce

  1. Install Continue extension on Windows (LOCAL, not WSL)
  2. Connect VS Code to WSL
  3. Ask Continue to run a terminal command (e.g., "What folder are we in?")
  4. Command runs visibly in terminal but Continue shows "Terminal output not available"

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    ide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions