Fix: Use VSCode Extension API for remote SSH connection (Trae IDE support) #5
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/trae-ide-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix: Use VSCode Extension API for Remote SSH Connection (Trae IDE Support)
Problem
Trae IDE does not support the
--remoteCLI parameter (a feature specific to VSCode/Cursor).Error observed:
The original implementation uses terminal CLI commands to open remote SSH connections, which fails on Trae IDE.
Solution
Replace CLI command execution with VSCode Extension API (
vscode.commands.executeCommand). This approach works across all VSCode-based IDEs including VSCode, Cursor, and Trae.Changes
1.
openRemoteFolderMethodBefore:
After:
2.
openProjectWithoutLoggingFunctionSame changes as above.
URI Format Changes
vscode-remote://ssh-remote+root@my-server:1234/workspacevscode-remote://ssh-remote+my-server/workspaceUser root)Port 1234)my-server)Why this matters:
The new format uses the SSH config Host alias, allowing the
User rootand port settings in~/.ssh/configto take effect. This prevents URL parameters from overriding the correct SSH configuration.Example SSH config:
Locally tested on Vscode and Trae
6cdf60ced1to2e9126fe64WIP: Fix: Use VSCode Extension API for remote SSH connection (Trae IDE support)to Fix: Use VSCode Extension API for remote SSH connection (Trae IDE support)