pub enum ShellActivation {
Always,
AgentsOnly,
Off,
}Expand description
Controls when the shell hook auto-activates command aliases.
Always: (Default) Aliases are active in every interactive shell.AgentsOnly: Aliases only activate when an AI agent env var is detected (e.g.LEAN_CTX_AGENT,CLAUDECODE,CODEX_CLI_SESSION,GEMINI_SESSION). Perfect for users who only want lean-ctx when AI agents run shell commands.Off: Aliases never auto-activate. The user must calllean-ctx-onmanually.
Variants§
Implementations§
Source§impl ShellActivation
impl ShellActivation
pub fn from_env() -> Option<Self>
pub fn effective(config: &Config) -> Self
Sourcepub fn posix_guard(&self) -> &'static str
pub fn posix_guard(&self) -> &'static str
Returns the shell condition snippet that guards auto-activation. Used in generated shell hooks (posix, fish, powershell).
pub fn fish_guard(&self) -> &'static str
pub fn powershell_guard(&self) -> &'static str
Trait Implementations§
Source§impl Clone for ShellActivation
impl Clone for ShellActivation
Source§fn clone(&self) -> ShellActivation
fn clone(&self) -> ShellActivation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShellActivation
impl Debug for ShellActivation
Source§impl Default for ShellActivation
impl Default for ShellActivation
Source§fn default() -> ShellActivation
fn default() -> ShellActivation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ShellActivation
impl<'de> Deserialize<'de> for ShellActivation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ShellActivation
impl PartialEq for ShellActivation
Source§fn eq(&self, other: &ShellActivation) -> bool
fn eq(&self, other: &ShellActivation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ShellActivation
impl Serialize for ShellActivation
impl StructuralPartialEq for ShellActivation
Auto Trait Implementations§
impl Freeze for ShellActivation
impl RefUnwindSafe for ShellActivation
impl Send for ShellActivation
impl Sync for ShellActivation
impl Unpin for ShellActivation
impl UnsafeUnpin for ShellActivation
impl UnwindSafe for ShellActivation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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