fix: use basename for shell detection to support non-standard paths (#5205)

Co-authored-by: Ayato French <a@ayatofrench.com>
This commit is contained in:
secretninjaman 2025-12-07 13:08:26 -06:00 committed by GitHub
parent c16d8c6db8
commit 238b907dd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,8 @@ export const BashTool = Tool.define("bash", async () => {
const shell = iife(() => {
const s = process.env.SHELL
if (s) {
if (!new Set(["/bin/fish", "/bin/nu", "/usr/bin/fish", "/usr/bin/nu"]).has(s)) {
const basename = path.basename(s);
if (!new Set(["fish", "nu"]).has(basename)) {
return s
}
}