gitui-org/gitui · error · anyhow::Error
"{command}": {e}
Error message
"{command}": {e} What it means
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.
Source
Thrown at src/popups/externaleditor.rs:116
.take_while(|c| *c != '\"')
.collect()
} else {
echars.by_ref().take_while(|c| *c != ' ').collect()
};
let remainder_str = echars.collect::<String>();
let remainder = remainder_str.split_whitespace();
let mut args: Vec<&OsStr> =
remainder.map(OsStr::new).collect();
args.push(path.as_os_str());
Command::new(command.clone())
.current_dir(work_dir)
.args(args)
.status()
.map_err(|e| anyhow!("\"{command}\": {e}"))?;
Ok(())
}
}
impl DrawableComponent for ExternalEditorPopup {
fn draw(&self, f: &mut Frame, _rect: Rect) -> Result<()> {
if self.visible {
let txt = Line::from(
strings::msg_opening_editor(&self.key_config)
.split('\n')
.map(|string| {
Span::raw::<String>(string.to_string())
})
.collect::<Vec<Span>>(),
);
let area = ui::centered_rect_absolute(25, 3, f.area());View on GitHub (pinned to 2fa693cb6e)
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.
Example fix
# before export EDITOR=nvim # nvim not installed -> "nvim": No such file or directory (os error 2) # after command -v nvim || sudo apt install neovim # or point at an absolute path export EDITOR=/usr/bin/vim
Defensive patterns
Strategy: validation
Validate before calling
# before relying on gitui's edit action
command -v "${EDITOR:-vi}" >/dev/null || echo "editor missing or not on PATH: $EDITOR"
// Rust: which-style probe honoring gitui's quoting
fn editor_on_path(editor: &str) -> bool {
let bin = editor.strip_prefix('"').and_then(|r| r.split('"').next())
.or_else(|| editor.split_whitespace().next())
.unwrap_or("");
which::which(bin).is_ok()
} Try / catch
match edit_in_external_editor() {
Err(e) if e.to_string().contains("No such file") => warn("$EDITOR is not installed"),
r => r?,
} Prevention
- 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).
When it happens
Trigger: 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.
Common situations: Fresh machines before editor packages are installed; PATH differences between interactive login shells and launchers; editors renamed after a distribution upgrade.
Related errors
- `{command:?}`: {e:?}
- Could not select commit. It might not be loaded yet or it mi
- editor env variable found empty: {}
- invalid path
AI-assisted analysis of gitui-org/gitui@2fa693cb6e (2026-08-16).
Data as JSON: /api/errors/d050f0b73eaacf73.
Report an issue: GitHub.