{"record":{"id":"d050f0b73eaacf73","repo":"gitui-org/gitui","slug":"command-e-d050f0","errorCode":null,"errorMessage":"\"{command}\": {e}","messagePattern":"\"\\{command\\}\": \\{e\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/popups/externaleditor.rs","lineNumber":116,"sourceCode":"\t\t\t\t.take_while(|c| *c != '\\\"')\n\t\t\t\t.collect()\n\t\t} else {\n\t\t\techars.by_ref().take_while(|c| *c != ' ').collect()\n\t\t};\n\n\t\tlet remainder_str = echars.collect::<String>();\n\t\tlet remainder = remainder_str.split_whitespace();\n\n\t\tlet mut args: Vec<&OsStr> =\n\t\t\tremainder.map(OsStr::new).collect();\n\n\t\targs.push(path.as_os_str());\n\n\t\tCommand::new(command.clone())\n\t\t\t.current_dir(work_dir)\n\t\t\t.args(args)\n\t\t\t.status()\n\t\t\t.map_err(|e| anyhow!(\"\\\"{command}\\\": {e}\"))?;\n\n\t\tOk(())\n\t}\n}\n\nimpl DrawableComponent for ExternalEditorPopup {\n\tfn draw(&self, f: &mut Frame, _rect: Rect) -> Result<()> {\n\t\tif self.visible {\n\t\t\tlet txt = Line::from(\n\t\t\t\tstrings::msg_opening_editor(&self.key_config)\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map(|string| {\n\t\t\t\t\t\tSpan::raw::<String>(string.to_string())\n\t\t\t\t\t})\n\t\t\t\t\t.collect::<Vec<Span>>(),\n\t\t\t);\n\n\t\t\tlet area = ui::centered_rect_absolute(25, 3, f.area());","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/gitui-org/gitui/blob/2fa693cb6ed431b21ebc300dd02e83c2476699ce/src/popups/externaleditor.rs#L98-L134","documentation":"Launching the external editor failed at Command::status(): the program string parsed out of the EDITOR variable could not be executed. Almost always ErrorKind::NotFound - the named editor is not installed or not on the PATH gitui inherited - sometimes PermissionDenied (file not executable) or a quoting artifact, because gitui's parsing only understands a leading double-quoted program name or a space-split first token.","triggerScenarios":"EDITOR=nvim with neovim absent; EDITOR pointing at a script without the executable bit; an editor installed under ~/.local/bin that is not on PATH in the launcher's environment (systemd, IDE-embedded terminals); values with unusual quoting that defeat the naive split.","commonSituations":"Fresh machines before editor packages are installed; PATH differences between interactive login shells and launchers; editors renamed after a distribution upgrade.","solutions":["Verify from the same environment: command -v \"$EDITOR\" must resolve to an executable binary.","Keep EDITOR a single unquoted token (EDITOR=vim) or ensure quoting matches gitui's expectations; avoid exotic embedded quotes.","Prepend the editor's directory to PATH in the launcher, or set EDITOR to the absolute path of the binary.","Make sure the target is executable: chmod +x ~/.local/bin/myeditor."],"exampleFix":"# before\nexport EDITOR=nvim   # nvim not installed -> \"nvim\": No such file or directory (os error 2)\n# after\ncommand -v nvim || sudo apt install neovim\n# or point at an absolute path\nexport EDITOR=/usr/bin/vim","handlingStrategy":"validation","validationCode":"# before relying on gitui's edit action\ncommand -v \"${EDITOR:-vi}\" >/dev/null || echo \"editor missing or not on PATH: $EDITOR\"\n\n// Rust: which-style probe honoring gitui's quoting\nfn editor_on_path(editor: &str) -> bool {\n    let bin = editor.strip_prefix('\"').and_then(|r| r.split('\"').next())\n        .or_else(|| editor.split_whitespace().next())\n        .unwrap_or(\"\");\n    which::which(bin).is_ok()\n}","typeGuard":null,"tryCatchPattern":"match edit_in_external_editor() {\n    Err(e) if e.to_string().contains(\"No such file\") => warn(\"$EDITOR is not installed\"),\n    r => r?,\n}","preventionTips":["Keep EDITOR a single unquoted token (vim, nvim) or a well-formed 'prog args' pair.","Re-check EDITOR after reinstalling or renaming editors, and after changing shells.","Ensure the editor's bin dir is on PATH for non-login launchers too (systemd, IDE terminals)."],"tags":["editor","spawn","not-found","path","quoting"],"backgroundTag":"command-not-found","analyzedSha":"2fa693cb6ed431b21ebc300dd02e83c2476699ce","analyzedAt":"2026-08-16T23:07:36.562Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}