pub enum Shell {
Sh,
Bash,
Fish,
Zsh,
Xonsh,
Nu,
Powershell,
Unknown,
}
Variants§
Implementations§
Source§impl Shell
impl Shell
pub fn current() -> Shell
pub fn config_file(&self) -> Option<PathBuf>
Sourcepub fn default_shell() -> Result<Shell, ShellError>
pub fn default_shell() -> Result<Shell, ShellError>
Best-effort attempt to determine the default shell This implementation will be different across different platforms Caller should ensure to handle Shell::Unknown correctly
pub fn from_string(name: String) -> Shell
Sourcepub fn is_posixish(&self) -> bool
pub fn is_posixish(&self) -> bool
Returns true if the shell is posix-like Note that while fish is not posix compliant, it behaves well enough for our current featureset that this does not matter.
pub fn run_interactive<I, S>(&self, args: I) -> Result<String, ShellError>
Trait Implementations§
impl StructuralPartialEq for Shell
Auto Trait Implementations§
impl Freeze for Shell
impl RefUnwindSafe for Shell
impl Send for Shell
impl Sync for Shell
impl Unpin for Shell
impl UnwindSafe for Shell
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more