Skip to main content

Module hook

Module hook 

Source
Expand description

Per-keystroke hook logic, centralising what each shell template used to re-implement in bash/zsh/pwsh/clink/nu. The goal is that shells provide a thin “buffer + cursor in, eval-able string out” adapter and all the real expansion logic — command-position detection, token extraction, cursor placeholder handling, shell escaping — lives here in Rust.

Enums§

HookAction
Outcome of a hook call — what the shell adapter should do to its buffer.

Functions§

hook
Core hook entry point, shell-agnostic.
is_command_position
Returns true when the characters to the left of the token we’re about to consider represent a position where a fresh command name is expected.
render_action
Render a HookAction into a shell-specific eval-able string. The shell integration script consumes this verbatim via eval (or equivalent).