denisidoro/navi · error

No variables received from finder

Error message

No variables received from finder

What it means

This is a panic raised by an `expect` in the `act` command of this CLI. `act` asks an external fuzzy finder (fzf/television/etc.) to let the user pick variables, and the finder's stdout channel delivers them back as `Option<Vec<String>>`. If that option is `None` — no variables were received from the finder subprocess — the command panics with this message instead of returning a graceful error.

Source

Thrown at src/commands/core/actor.rs:236

            ..
        },
    ) = extractions.unwrap();

    if key == "ctrl-o" {
        edit::edit_file(Path::new(&files[file_index.expect("No files found")]))
            .expect("Could not open file in external editor");
        return Ok(());
    }

    env_var::set(env_var::PREVIEW_INITIAL_SNIPPET, &snippet);
    env_var::set(env_var::PREVIEW_TAGS, &tags);
    env_var::set(env_var::PREVIEW_COMMENT, comment);

    let interpolated_snippet = {
        let mut s = replace_variables_from_snippet(
            &snippet,
            &tags,
            variables.expect("No variables received from finder"),
        )
        .context("Failed to replace variables from snippet")?;
        s = with_absolute_path(s);
        s = deser::with_new_lines(s);
        s
    };

    match CONFIG.action() {
        Action::Print => {
            println!("{interpolated_snippet}");
        }
        Action::Execute => match key {
            "ctrl-y" => {
                clipboard::copy(interpolated_snippet)?;
            }
            _ => {
                let mut cmd = shell::out();
                cmd.arg(&interpolated_snippet[..]);

View on GitHub (pinned to f7330b9ad5)

Solutions

  1. Ensure the configured finder (fzf/television/skim per your config) is installed and on PATH and works interactively: `fzf --version`
  2. Run `act` in a real terminal (TTY) — finders need one; don't pipe stdout when selecting variables
  3. Check the finder selection in your config matches an installed finder and re-select a snippet that has variables
  4. If the panic is spurious, capture the finder invocation and file a bug with repro steps

Example fix

// before (library code)
variables.expect("No variables received from finder")
// after
variables.ok_or_else(|| anyhow!("No variables received from finder; did the finder exit without a selection?"))?
Defensive patterns

Strategy: validation

Validate before calling

if !which(config.finder.as_deref().unwrap_or("fzf")).is_ok() {
    eprintln!("finder binary not found on PATH; cannot gather variables");
    std::process::exit(1);
}
// also ensure stdout is a TTY before running `act`

Type guard

fn has_variables(v: &Option<Vec<String>>) -> bool {
    matches!(v, Some(vars) if !vars.is_empty())
}

Try / catch

match result {
    Ok(vars) => vars,
    Err(e) => { eprintln!("variable selection failed: {e}"); std::process::exit(1); }
} // note: `expect` panics are not catchable as Err; wrap with catch_unwind only as last resort

Prevention

When it happens

Trigger: Running `act` with a snippet that has tags/variables where the finder process returns no variable data on stdout: the finder exits without selection output, stdout is closed early, or the plumbing between finder and actor drops the message.

Common situations: Broken or missing finder binary configured (fzf not installed or not on PATH in the environment `act` runs in); finder killed by signal or exiting non-zero; piping `act` output so the finder has no TTY; a version change in the finder output format.

Related errors


AI-assisted analysis of denisidoro/navi@f7330b9ad5 (2026-09-03). Data as JSON: /api/errors/711d2d41eea6a964. Report an issue: GitHub.