Expand description
Portable executable discovery.
Winx used to probe for programs with sh -c 'command -v …', which assumes a
POSIX shell on PATH. Native Windows has no sh, and its bash.exe may be
the WSL launcher in System32 rather than a usable shell, so lookups are
done directly against PATH (honoring PATHEXT on Windows) and the known
Git for Windows install locations.
Enums§
- Shell
Kind - Shell family Winx drives in the PTY. It decides the prompt bootstrap, the completion marker, and which statement policy applies to commands.
Functions§
- bash_
executable - The
bashexecutable Winx should drive. On Unix this is whateverPATHresolves. On Windows the Git for Windows shell is preferred andSystem32\bash.exe(the WSL launcher, which needs a distribution and does not honorPROMPT_COMMAND) is never selected. - find_
on_ path - Locate
programonPATH. A name with a path separator is checked as-is. On Windows, a bare name is tried with everyPATHEXTsuffix (.exe,.cmd, …) as well as verbatim. - is_
available - Whether
programcan be found onPATH. Best-effort: used for advisory hints and shell selection, never as a security boundary. - powershell_
executable - PowerShell to drive when requested (or when Windows has no Git for Windows
bash). PowerShell 7 (
pwsh) is preferred; Windows PowerShell 5.1 is the fallback on Windows only. - shell_
kind_ of - Classify a shell selection (
zsh,/bin/zsh,pwsh,C:\\...\\pwsh.exe,powershell) by its basename; anything unrecognized is driven as bash.