-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Terminal output not captured when Windows VS Code connects to WSL (follow-up to #9679) #9731
Copy link
Copy link
Closed
Labels
ide:vscodeRelates specifically to VS Code extensionRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on WindowsHappening specifically on Windows
Description
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
- OS: Windows 11 with WSL2 (Ubuntu)
- Continue version: Built from feature branch with fix: use ide.runCommand when Windows host connects to WSL #9679 merged
- IDE version: VS Code 1.96+
- Extension installed: LOCAL (Windows)
Description
This is a follow-up to #9679 which fixed the spawn powershell.exe ENOENT error when Windows VS Code connects to WSL.
Background:
- Issue Bug: Cannot run commands in terminal "The URL must be of scheme file" #8091 reported "The URL must be of scheme file" - fixed by PR fix: handle non-file URI schemes in runTerminalCommand for WSL2 #9325
- Issue VSCode: spawn powershell.exe ENOENT #9661 reported "spawn powershell.exe ENOENT" - fixed by PR fix: use ide.runCommand when Windows host connects to WSL #9679
- PR fix: use ide.runCommand when Windows host connects to WSL #9679 detects
isWindowsHostWithWslRemoteand falls through toide.runCommand()instead of spawning
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
- Install Continue extension on Windows (LOCAL, not WSL)
- Connect VS Code to WSL
- Ask Continue to run a terminal command (e.g., "What folder are we in?")
- Command runs visibly in terminal but Continue shows "Terminal output not available"
Related issues
- Bug: Cannot run commands in terminal "The URL must be of scheme file" #8091 - Original "scheme file" error (fixed by fix: handle non-file URI schemes in runTerminalCommand for WSL2 #9325)
- VSCode: spawn powershell.exe ENOENT #9661 - spawn powershell.exe ENOENT (fixed by fix: use ide.runCommand when Windows host connects to WSL #9679)
- Continue VS Code extension fails to start MCP servers in WSL workspaces (looks for cmd.exe inside Ubuntu) #9151 - MCP servers in WSL look for cmd.exe
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ide:vscodeRelates specifically to VS Code extensionRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on WindowsHappening specifically on Windows
Type
Projects
Status
Done