Skip to main content

hook

Function hook 

Source
pub fn hook<F>(
    config: &Config,
    shell: Shell,
    line: &str,
    cursor: usize,
    command_exists: F,
) -> HookAction
where F: Fn(&str) -> bool,
Expand description

Core hook entry point, shell-agnostic.

line is the shell’s current buffer, cursor is the byte offset of the caret. If a known abbreviation ends at the cursor and the prefix is a command position, expand it; otherwise fall back to inserting a space.