mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fixes
This commit is contained in:
parent
508901001f
commit
a54551c8c8
2 changed files with 7 additions and 5 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue