{"record":{"id":"711d2d41eea6a964","repo":"denisidoro/navi","slug":"no-variables-received-from-finder","errorCode":null,"errorMessage":"No variables received from finder","messagePattern":"No variables received from finder","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commands/core/actor.rs","lineNumber":236,"sourceCode":"            ..\n        },\n    ) = extractions.unwrap();\n\n    if key == \"ctrl-o\" {\n        edit::edit_file(Path::new(&files[file_index.expect(\"No files found\")]))\n            .expect(\"Could not open file in external editor\");\n        return Ok(());\n    }\n\n    env_var::set(env_var::PREVIEW_INITIAL_SNIPPET, &snippet);\n    env_var::set(env_var::PREVIEW_TAGS, &tags);\n    env_var::set(env_var::PREVIEW_COMMENT, comment);\n\n    let interpolated_snippet = {\n        let mut s = replace_variables_from_snippet(\n            &snippet,\n            &tags,\n            variables.expect(\"No variables received from finder\"),\n        )\n        .context(\"Failed to replace variables from snippet\")?;\n        s = with_absolute_path(s);\n        s = deser::with_new_lines(s);\n        s\n    };\n\n    match CONFIG.action() {\n        Action::Print => {\n            println!(\"{interpolated_snippet}\");\n        }\n        Action::Execute => match key {\n            \"ctrl-y\" => {\n                clipboard::copy(interpolated_snippet)?;\n            }\n            _ => {\n                let mut cmd = shell::out();\n                cmd.arg(&interpolated_snippet[..]);","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/denisidoro/navi/blob/f7330b9ad5bd95b7d1a3c96d00e0a77deb589147/src/commands/core/actor.rs#L218-L254","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the configured finder (fzf/television/skim per your config) is installed and on PATH and works interactively: `fzf --version`","Run `act` in a real terminal (TTY) — finders need one; don't pipe stdout when selecting variables","Check the finder selection in your config matches an installed finder and re-select a snippet that has variables","If the panic is spurious, capture the finder invocation and file a bug with repro steps"],"exampleFix":"// before (library code)\nvariables.expect(\"No variables received from finder\")\n// after\nvariables.ok_or_else(|| anyhow!(\"No variables received from finder; did the finder exit without a selection?\"))?","handlingStrategy":"validation","validationCode":"if !which(config.finder.as_deref().unwrap_or(\"fzf\")).is_ok() {\n    eprintln!(\"finder binary not found on PATH; cannot gather variables\");\n    std::process::exit(1);\n}\n// also ensure stdout is a TTY before running `act`","typeGuard":"fn has_variables(v: &Option<Vec<String>>) -> bool {\n    matches!(v, Some(vars) if !vars.is_empty())\n}","tryCatchPattern":"match result {\n    Ok(vars) => vars,\n    Err(e) => { eprintln!(\"variable selection failed: {e}\"); std::process::exit(1); }\n} // note: `expect` panics are not catchable as Err; wrap with catch_unwind only as last resort","preventionTips":["Verify the finder binary (fzf/television/skim) is installed and on PATH before scripting `act`","Always run interactive selection in a real TTY; avoid piping stdout during selection","Keep the finder config in sync with the CLI version you run","Patch library expects into Result-returning errors for scriptable use"],"tags":["rust","panic","finder","interactive"],"backgroundTag":"finder-selection-failed","analyzedSha":"f7330b9ad5bd95b7d1a3c96d00e0a77deb589147","analyzedAt":"2026-09-03T13:58:22.429Z","contentChangedAt":"2026-09-03T13:58:22.429Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}