From daa1f542f9abc4082771ed8606d130473b4146f7 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sun, 8 Mar 2026 01:43:00 -0800 Subject: [PATCH] fix: enhance shell detection in local environment configuration Updated the _find_shell function to improve shell detection on non-Windows systems. The function now checks for the existence of /usr/bin/bash and /bin/bash before falling back to /bin/sh, ensuring a more robust shell resolution process. --- tools/environments/local.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/environments/local.py b/tools/environments/local.py index 78be54c7..ad409483 100644 --- a/tools/environments/local.py +++ b/tools/environments/local.py @@ -25,7 +25,13 @@ def _find_shell() -> str: Raises RuntimeError if no suitable shell is found on Windows. """ if not _IS_WINDOWS: - return os.environ.get("SHELL") or shutil.which("bash") or "/bin/bash" + return ( + os.environ.get("SHELL") + or shutil.which("bash") + or ("/usr/bin/bash" if os.path.isfile("/usr/bin/bash") else None) + or ("/bin/bash" if os.path.isfile("/bin/bash") else None) + or "/bin/sh" + ) # Windows: look for Git Bash (installed with Git for Windows). # Allow override via env var (same pattern as Claude Code).