Skip to main content

Module shell_hook

Module shell_hook 

Source

Enums§

Style
Installation style for the shell hook + agent aliases.

Constants§

KNOWN_AGENT_ENV_VARS
Variables an agent host sets in its agent’s shell; the shell hook redirects through lean-ctx when one is set.
MORE_AGENT_ENV_VARS
Further variables only an agent’s process carries, beyond KNOWN_AGENT_ENV_VARS. Together they are the one list of agent markers (agent_env_marker) for commands an agent must not run.

Functions§

agent_env_marker
The first agent marker is_set reports.
agent_env_markers
Every agent marker: KNOWN_AGENT_ENV_VARS, then MORE_AGENT_ENV_VARS.
env_agent_marker
The first agent marker set (non-empty) in this process’s environment.
install_all
Public entrypoint: install with auto-detected style. Preserves the previous signature so existing callers (setup.rs, cli/shell_init.rs) don’t need to change.
install_all_with_style
Explicit style entrypoint for callers that want to honour a --style= CLI flag.
refresh_installed_shell_hooks
Bring installed shell hooks up to this binary, if a refresh is registered.
register_installed_hook_refresh
Register the installed shell-hook refresh. The first registration wins.
reload_aliases_hint
Human-facing one-liner telling the user how to load the refreshed aliases, tailored to their login shell. Used after lean-ctx update.
shell_rc_file
The rc file path for the user’s current login shell ($SHELL), or a generic fallback when it cannot be determined. Used in help text and troubleshooting hints so they never hardcode a single shell’s rc file.
shell_source_command
The source <rc> command for the user’s current login shell ($SHELL), or None when it cannot be determined. Single source of truth so post-setup and post-update hints stay in sync and never advise sourcing a shell the user does not have (e.g. ~/.zshrc on a bash-only system — see #321).
uninstall_all