pub fn detect_shell() -> Result<ShellType>Expand description
Detect the user’s shell from the $SHELL environment variable.
Parses the shell path (e.g., /bin/zsh, /usr/bin/bash) and returns
the corresponding ShellType.
§Returns
Ok(ShellType)- The detected shell typeErr(Autom8Error)- If$SHELLis not set or the shell is unsupported
§Examples
ⓘ
// With $SHELL=/bin/zsh
let shell = detect_shell()?;
assert_eq!(shell, ShellType::Zsh);