can1357/oh-my-pi · error · BindError
unknown key binding function: {0}
Error message
unknown key binding function: {0} What it means
`BindError::UnknownKeyBindingFunction` is raised by the `bind` builtin when a key sequence is being bound to a named function (`bind KEY_SEQ FUNC` or `bind -x` style usage) and the function name on the right-hand side is not recognized as a key binding function. It is distinct from `UnknownFunction` (queries/removals) in that it occurs while establishing a binding. The message echoes the unrecognized name.
Source
Thrown at crates/pi-builtins/src/bind.rs:96
bindings_file: Option<String>,
/// Bind key sequence to command.
#[arg(short = 'x', value_name = "BINDING")]
key_seq_bindings: Vec<String>,
/// List key sequence bindings.
#[arg(short = 'X')]
list_key_seq_bindings: bool,
/// Key sequence binding to readline function or command.
key_sequence: Option<String>,
}
#[derive(Debug, thiserror::Error)]
pub(crate) enum BindError {
/// Unknown function specified.
#[error("unknown function: {0}")]
UnknownFunction(String),
/// Unknown key binding function.
#[error("unknown key binding function: {0}")]
UnknownKeyBindingFunction(String),
/// Unimplemented functionality.
#[error("unimplemented: {0}")]
Unimplemented(&'static str),
/// An I/O error occurred.
#[error("I/O error occurred")]
IoError(#[from] std::io::Error),
/// A binding parse error occurred.
#[error(transparent)]
BindingParseError(#[from] brush_parser::BindingParseError),
}
impl brush_core::BuiltinError for BindError {}
impl From<&BindError> for brush_core::ExecutionExitCode {View on GitHub (pinned to 9690622007)
Solutions
- Run `bind -l` to enumerate supported functions and correct the name in the binding.
- Bind to a shell command instead of a function if no equivalent function exists: use `bind -x '"seq": command'` style.
- Remove or comment out the unsupported binding from your startup scripts/.inputrc.
Example fix
// before $ bind '\C-o' upcase-word-old unknown key binding function: upcase-word-old // after $ bind -l | grep word $ bind '\C-o' upcase-word
Defensive patterns
Strategy: validation
Validate before calling
// validate the function side of a binding before applying it FUNC="upcase-word" if ! bind -l | grep -qx "$FUNC"; then echo "skip binding: unknown function $FUNC" >&2 else bind '\C-o' "$FUNC" fi
Prevention
- Test .inputrc/bind lines in an interactive brush session before committing them to startup files.
- Wrap config-level bindings in existence checks so one bad name doesn't abort a sourced script.
- Prefer `bind -x` shell-command bindings when no readline function equivalent exists.
When it happens
Trigger: Invoking `bind <key_sequence> <function>` (the positional `key_sequence` argument containing a function name) where the function portion does not match any known input function in the shell's keymap tables.
Common situations: Porting `.inputrc` or bash `bind` lines into brush configs; using bash-only readline functions brush has not implemented; typos in the function part of a binding like `bind '\C-x\C-e' edit-and-exectue-command`.
Related errors
- unknown function: {0}
- unimplemented: {0}
- transparent (brush_parser::BindingParseError)
- I/O error occurred
- {}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/fea92597b1a2ec3e.
Report an issue: GitHub.