{"record":{"id":"fea92597b1a2ec3e","repo":"can1357/oh-my-pi","slug":"unknown-key-binding-function-0","errorCode":null,"errorMessage":"unknown key binding function: {0}","messagePattern":"unknown key binding function: (.+?)","errorType":"exception","errorClass":"BindError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/bind.rs","lineNumber":96,"sourceCode":"\tbindings_file: Option<String>,\n\t/// Bind key sequence to command.\n\t#[arg(short = 'x', value_name = \"BINDING\")]\n\tkey_seq_bindings: Vec<String>,\n\t/// List key sequence bindings.\n\t#[arg(short = 'X')]\n\tlist_key_seq_bindings: bool,\n\t/// Key sequence binding to readline function or command.\n\tkey_sequence: Option<String>,\n}\n\n#[derive(Debug, thiserror::Error)]\npub(crate) enum BindError {\n\t/// Unknown function specified.\n\t#[error(\"unknown function: {0}\")]\n\tUnknownFunction(String),\n\n\t/// Unknown key binding function.\n\t#[error(\"unknown key binding function: {0}\")]\n\tUnknownKeyBindingFunction(String),\n\n\t/// Unimplemented functionality.\n\t#[error(\"unimplemented: {0}\")]\n\tUnimplemented(&'static str),\n\n\t/// An I/O error occurred.\n\t#[error(\"I/O error occurred\")]\n\tIoError(#[from] std::io::Error),\n\n\t/// A binding parse error occurred.\n\t#[error(transparent)]\n\tBindingParseError(#[from] brush_parser::BindingParseError),\n}\n\nimpl brush_core::BuiltinError for BindError {}\n\nimpl From<&BindError> for brush_core::ExecutionExitCode {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/bind.rs#L78-L114","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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`.","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."],"exampleFix":"// before\n$ bind '\\C-o' upcase-word-old\nunknown key binding function: upcase-word-old\n// after\n$ bind -l | grep word\n$ bind '\\C-o' upcase-word","handlingStrategy":"validation","validationCode":"// validate the function side of a binding before applying it\nFUNC=\"upcase-word\"\nif ! bind -l | grep -qx \"$FUNC\"; then\n  echo \"skip binding: unknown function $FUNC\" >&2\nelse\n  bind '\\C-o' \"$FUNC\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["shell","builtin","key-binding","invalid-argument"],"backgroundTag":"unknown-readline-function","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}