Commit graph

9 commits

Author SHA1 Message Date
shanevcantwell
c79e6489a7
fix: restrict terminal childProcess.spawn to local-only environments (#10538)
fix: restrict childProcess.spawn to local-only environments

childProcess.spawn executes on the extension host machine. With
extensionKind: ["ui", "workspace"], the extension host almost always
runs locally. For any remote workspace (SSH, WSL, Dev Container,
Codespaces, tunnel), spawning locally either runs commands on the wrong
machine or fails with ENOENT when the local shell doesn't exist in the
extension host context.

Replace ENABLED_FOR_REMOTES (which listed all remote types) with
LOCAL_ONLY (just "" and "local"). All remote types now fall through to
ide.runCommand() which delegates to VS Code's integrated terminal and
executes in the correct remote environment.

The isWindowsHostWithRemote guard is removed as it is now redundant —
the platform-agnostic check handles all cases.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 20:33:04 -07:00
shanevcantwell
c565bdc464 fix: use ide.runCommand when Windows host connects to WSL
When the VS Code extension runs on Windows but connects to WSL,
direct shell spawning fails because process.platform is "win32"
but commands should execute in the Linux WSL environment.

This caused: spawn powershell.exe ENOENT

The fix detects this scenario and falls back to ide.runCommand(),
letting VS Code handle the remote terminal execution properly.

Fixes #9661

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 10:55:16 -07:00
shanevcantwell
8e5a7c2152 refactor: generalize remote URI handling and remove CLAUDE.md
- Remove WSL-specific check in favor of generic URI handling
- Support all vscode-remote:// URI schemes (WSL, SSH, dev-container)
- Prefer file:// URIs when available, fall back to remote URIs
- Add tests for various remote URI formats
- Remove CLAUDE.md per reviewer feedback (use AGENTS.md convention)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:08:33 -07:00
Dallin Romney
462e7168bd fix: terminal cwd tests 2025-11-24 15:12:20 -08:00
chezsmithy
acbba9b7d0 fix: 🐛 Fixes based on reviewer comments 2025-09-09 10:14:09 -07:00
chezsmithy
58cb7815ca feat: Add ability to stop foreground terminal commands 2025-09-09 10:12:59 -07:00
Tomasz Stefaniak
6bcf040dee fix: formatting 2025-08-27 15:29:55 -07:00
Tomasz Stefaniak
9c7adc5b60 feat: evaluateTerminalCommandSecurity command 2025-08-27 15:28:19 -07:00
Tomasz Stefaniak
a7ceb4e033 test: dynamic policy evaluation 2025-08-26 15:37:02 -07:00
Renamed from core/tools/implementations/runTerminalCommand.test.ts (Browse further)