Skip to content

Commit 238b907

Browse files
ayatofrenchAyato French
andauthored
fix: use basename for shell detection to support non-standard paths (#5205)
Co-authored-by: Ayato French <[email protected]>
1 parent c16d8c6 commit 238b907

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/opencode/src/tool/bash.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export const BashTool = Tool.define("bash", async () => {
6060
const shell = iife(() => {
6161
const s = process.env.SHELL
6262
if (s) {
63-
if (!new Set(["/bin/fish", "/bin/nu", "/usr/bin/fish", "/usr/bin/nu"]).has(s)) {
63+
const basename = path.basename(s);
64+
if (!new Set(["fish", "nu"]).has(basename)) {
6465
return s
6566
}
6667
}

0 commit comments

Comments
 (0)