This commit is contained in:
Aiden Cline 2025-12-12 15:31:22 -06:00
parent 508901001f
commit a54551c8c8
2 changed files with 7 additions and 5 deletions

View file

@ -1252,7 +1252,9 @@ export namespace SessionPrompt {
}
await Session.updatePart(part)
const shell = Shell.preferred()
const shellName = path.basename(shell).toLowerCase()
const shellName = (
process.platform === "win32" ? path.win32.basename(shell, ".exe") : path.basename(shell)
).toLowerCase()
const invocations: Record<string, { args: string[] }> = {
nu: {
@ -1282,12 +1284,12 @@ export namespace SessionPrompt {
`,
],
},
// Windows cmd.exe
"cmd.exe": {
// Windows cmd
cmd: {
args: ["/c", input.command],
},
// Windows PowerShell
"powershell.exe": {
powershell: {
args: ["-NoProfile", "-Command", input.command],
},
pwsh: {

View file

@ -61,7 +61,7 @@ export namespace Shell {
export const acceptable = lazy(() => {
const s = process.env.SHELL
if (s && !BLACKLIST.has(path.basename(s))) return s
if (s && !BLACKLIST.has(process.platform === "win32" ? path.win32.basename(s) : path.basename(s))) return s
return fallback()
})
}