From d3252e567e34d85a0a0c04023601a49c63307793 Mon Sep 17 00:00:00 2001 From: GILGAMESH <~@gilgamesh.cc> Date: Wed, 19 Nov 2025 09:36:47 -0700 Subject: [PATCH] use `dir ..` for shell detection on windows --- src/serverSetup.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/serverSetup.ts b/src/serverSetup.ts index 0709a0f..3c01621 100644 --- a/src/serverSetup.ts +++ b/src/serverSetup.ts @@ -42,23 +42,16 @@ export async function installCodeServer(conn: SSHConnection, serverDownloadUrlTe // detect platform and shell for windows if (!platform || platform === 'windows') { - const result = await conn.exec('uname -s'); + const result = await conn.exec('dir ..'); if (result.stdout) { - if (result.stdout.includes('windows32')) { - platform = 'windows'; - } else if (result.stdout.includes('MINGW64')) { - platform = 'windows'; - shell = 'bash'; - } - } else if (result.stderr) { - if (result.stderr.includes('FullyQualifiedErrorId : CommandNotFoundException')) { - platform = 'windows'; - } - - if (result.stderr.includes('is not recognized as an internal or external command')) { - platform = 'windows'; + platform = 'windows'; + if (result.stdout.includes('LastWriteTime')) { + shell = 'powershell'; + } else if (result.stdout.includes('