Documentation
¶
Overview ¶
Package shellenv resolves the shell interpreter used to run agent and workflow shell commands, so run_shell works on every platform.
The whole system emits POSIX commands (ls, grep, cat, rm, pipes, &&, $VAR) and the run_shell safety denylist is POSIX-shaped, so a POSIX shell is always preferred. On Linux/macOS that shell is always present (/bin/sh). On Windows we discover a bash (Git for Windows, MSYS2, or an explicit override) so agents behave identically across platforms. When no POSIX shell exists on a Windows host we fall back to PowerShell so run_shell still works rather than failing outright — behaviour is best-effort there, but the tool remains usable.
Index ¶
Constants ¶
const EnvOverride = "TOLLECODE_SHELL"
EnvOverride is the environment variable that pins the shell interpreter, taking precedence over discovery. Point it at a bash.exe/sh.exe on Windows.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shell ¶
Shell is a resolved interpreter and its family.
func Lookup ¶
Lookup returns the interpreter to run a command with. On Linux/macOS it is the unixDefault ("sh" or "bash") as a POSIX shell, preserving each call site's historical choice. On Windows it discovers a POSIX bash, falling back to PowerShell, and caches the result.