pub struct ShellDetector { /* private fields */ }Expand description
Shell detection utilities
Implementations§
Source§impl ShellDetector
impl ShellDetector
Sourcepub fn detect(&self) -> ShellType
pub fn detect(&self) -> ShellType
Detect the current shell from environment (instance method with fallback)
Sourcepub fn detect_from_env(&self) -> Option<ShellType>
pub fn detect_from_env(&self) -> Option<ShellType>
Detect shell from environment, returns None if not recognized
Sourcepub fn with_override(&self, shell: Option<ShellType>) -> ShellType
pub fn with_override(&self, shell: Option<ShellType>) -> ShellType
Set an override shell type
Sourcepub fn detect_with_fallback(fallback: ShellType) -> ShellType
pub fn detect_with_fallback(fallback: ShellType) -> ShellType
Detect shell with fallback (static method)
Sourcepub fn is_posix_shell() -> bool
pub fn is_posix_shell() -> bool
Check if the detected shell is POSIX-compatible (static method)
Sourcepub fn from_env_or_detect(env_var: &str) -> ShellType
pub fn from_env_or_detect(env_var: &str) -> ShellType
Get the shell from an environment variable or detect
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellDetector
impl RefUnwindSafe for ShellDetector
impl Send for ShellDetector
impl Sync for ShellDetector
impl Unpin for ShellDetector
impl UnwindSafe for ShellDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more