{"record":{"id":"107cd79141cf56c6","repo":"sxyazi/yazi","slug":"empty-key","errorCode":null,"errorMessage":"empty key","messagePattern":"empty key","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-config/src/keymap/key.rs","lineNumber":56,"sourceCode":"\t\t\tNone => (value.code, value.modifiers.contains(Modifiers::SHIFT)),\n\t\t};\n\n\t\tSelf {\n\t\t\tcode,\n\t\t\tshift,\n\t\t\tctrl: value.modifiers.contains(Modifiers::CONTROL),\n\t\t\talt: value.modifiers.contains(Modifiers::ALT),\n\t\t\tsuper_: value.modifiers.contains(Modifiers::SUPER),\n\t\t}\n\t}\n}\n\nimpl FromStr for Key {\n\ttype Err = anyhow::Error;\n\n\tfn from_str(s: &str) -> Result<Self, Self::Err> {\n\t\tif s.is_empty() {\n\t\t\tbail!(\"empty key\")\n\t\t}\n\n\t\tlet mut key = Self::default();\n\t\tif !s.starts_with('<') || !s.ends_with('>') {\n\t\t\tkey.code = KeyCode::Char(s.chars().next().unwrap());\n\t\t\tkey.shift = matches!(key.code, KeyCode::Char(c) if c.is_uppercase());\n\t\t\treturn Ok(key);\n\t\t}\n\n\t\tlet mut it = s[1..s.len() - 1].split_inclusive('-').peekable();\n\t\twhile let Some(next) = it.next() {\n\t\t\tmatch next.to_ascii_lowercase().as_str() {\n\t\t\t\t\"s-\" => key.shift = true,\n\t\t\t\t\"c-\" => key.ctrl = true,\n\t\t\t\t\"a-\" => key.alt = true,\n\t\t\t\t\"d-\" => key.super_ = true,\n\n\t\t\t\t\"space\" => key.code = KeyCode::Char(' '),","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-config/src/keymap/key.rs#L38-L74","documentation":"A validation guard in Key::from_str: keymap configuration strings are parsed into Key structs, and an empty string cannot denote any key. It fires when a keymap entry contains an empty key specification — typically a config mistake such as an empty `on` value or `<`/`>` markup that reduced to nothing — and prevents constructing a Key with an undefined code.","triggerScenarios":"Thrown at yazi-config/src/keymap/key.rs:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty key string in the keymap.","Remove the empty keybinding entry from keymap.toml."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}