fix: force PowerShell terminal on Windows for tunnel command

yoonhyunwoo committed Mar 8, 2026 at 14:41 UTC 366992ac8e42fac41f6ddce3a009458bcf02cb98
1 file changed +14 -1
extensions/vscode/src/extension.ts
+14 -1
@@ -45,7 +45,7 @@ async function startTunnel() {
45 if (tunnelTerminal) {
46 tunnelTerminal.dispose();
47 }
48 - tunnelTerminal = vscode.window.createTerminal("Portal Tunnel");
48 + tunnelTerminal = createTunnelTerminal();
49 tunnelTerminal.show();
50 tunnelTerminal.sendText(command);
51 }
@@ -139,6 +139,19 @@ function buildCommand(opts: TunnelCommandOptions): string {
139 return `curl ${curlFlags} ${tunnelScript} | APP_HOST=${host} APP_NAME=${name}${thumbEnv} RELAYS="${relayList}" sh`;
140 }
141
142 +function createTunnelTerminal(): vscode.Terminal {
143 + if (os.platform() !== "win32") {
144 + return vscode.window.createTerminal("Portal Tunnel");
145 + }
146 +
147 + // Force PowerShell on Windows so command syntax is consistent even if the
148 + // user's default profile is cmd/WSL/Git Bash.
149 + return vscode.window.createTerminal({
150 + name: "Portal Tunnel",
151 + shellPath: "powershell.exe",
152 + });
153 +}
154 +
155 function isLocalhost(url: string): boolean {
156 try {
157 const h = new URL(url).hostname.toLowerCase();