{"record":{"id":"0c843ac7bc0cfc2b","repo":"can1357/oh-my-pi","slug":"unknown-function-0","errorCode":null,"errorMessage":"unknown function: {0}","messagePattern":"unknown function: (.+?)","errorType":"exception","errorClass":"BindError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/bind.rs","lineNumber":92,"sourceCode":"\t#[arg(short = 'r', value_name = \"KEY_SEQ\")]\n\tremove_key_seq_binding: Option<String>,\n\t/// Import bindings from the given file.\n\t#[arg(short = 'f', value_name = \"PATH\")]\n\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}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/bind.rs#L74-L110","documentation":"`BindError::UnknownFunction` is raised by the `bind` builtin in the brush shell (pi-builtins) when the user names a readline/editing function that does not exist in the shell's function table. `bind` maps key sequences to named input functions; if the function name supplied by the user is not recognized, this error is returned and the builtin exits with a general error exit code. It signals a typo or an unsupported function name rather than a system failure.","triggerScenarios":"Running `bind -q FUNC_NAME` (query_func_bindings) or `bind -u FUNC_NAME` (remove_func_bindings) with a function name that is not a known key-binding function; generally, any `bind` invocation that references a function by name which the shell cannot resolve.","commonSituations":"Typing a function name copied from bash documentation that brush does not implement; misspelling a function name (e.g. `bind -q backword-word` instead of `backward-word`); shell scripts written for real bash referencing readline functions absent from brush.","solutions":["Run `bind -l` to list all functions the shell supports and use an exact name from that list.","Check spelling/casing of the function name; names must match exactly (e.g. `backward-word`, not `backward_word`).","If the function genuinely is not implemented in brush, remove or guard that binding in your shell config instead of relying on it."],"exampleFix":"// before\n$ bind -q backword-word\nunknown function: backword-word\n// after\n$ bind -l            # find the correct name\n$ bind -q backward-word","handlingStrategy":"validation","validationCode":"// shell-level check before scripting a bind query\nif ! bind -l | grep -qx \"$FUNC_NAME\"; then\n  echo \"function not supported: $FUNC_NAME\" >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always source function names from `bind -l` output, never from memory or bash docs.","Keep a lint step that greps shell init scripts for `bind` calls and cross-checks names.","Guard optional bindings with a helper that checks `bind -q` before binding."],"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"}