nikivdev/code · error

{} exited with status {}

Error message

{} exited with status {}

What it means

run_entry spawns the palette entry's command via Command::status. If the child process starts but exits with a non-zero status, present's runner reports the failure including the exit code (or -1 when the process was killed by a signal and has no code).

Source

Thrown at src/palette.rs:86

    let entry = entries.iter().find(|entry| entry.display == selection);
    Ok(entry.map(|e| FzfResult {
        entry: e,
        with_args,
    }))
}

fn run_entry(entry: &PaletteEntry, extra_args: Vec<String>) -> Result<()> {
    let exe = std::env::current_exe().context("failed to resolve current executable")?;
    let status = Command::new(exe)
        .args(&entry.exec)
        .args(&extra_args)
        .status()
        .with_context(|| format!("failed to run {}", entry.display))?;

    if status.success() {
        Ok(())
    } else {
        bail!(
            "{} exited with status {}",
            entry.display,
            status.code().unwrap_or(-1)
        );
    }
}

fn present(entries: Vec<PaletteEntry>) -> Result<()> {
    if entries.is_empty() {
        println!("No commands or tasks available. Add entries to flow.toml or global config.");
        return Ok(());
    }

    if which::which("fzf").is_err() {
        println!("fzf not found on PATH – install it to use fuzzy selection.");
        println!("Available commands:");
        for entry in &entries {
            println!("  {}", entry.display);

View on GitHub (pinned to a747e741ae)

Solutions

  1. Run the entry's command manually to see its real error output and fix the underlying failure.
  2. Update the palette entry definition to point at a working command or correct working directory.
  3. If the code is -1, the process was signal-killed; check for OOM or manual interruption.

Example fix

// before (palette entry)
{ display: "build", command: "cargo build --features missing" }
// exited with status 101

// after
{ display: "build", command: "cargo build" }
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(e) = run_entry(entry) {
    eprintln!("palette entry '{}' failed: {}", entry.display, e);
    // fall back or surface the child's own stderr
}

Prevention

When it happens

Trigger: Selecting a palette entry whose command runs and returns non-zero, e.g. a failing test script, or a command killed by a signal (unwrap_or(-1) path).

Common situations: Palette entry pointing at a script that fails in the current directory context; a linter/formatter finding issues; command killed by SIGINT/SIGKILL so status.code() is None.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/ecf28365d90678cc. Report an issue: GitHub.