{"record":{"id":"d83ea5a7e4c2af7d","repo":"nikivdev/code","slug":"fzf-not-found-install-it-for-fuzzy-selection","errorCode":null,"errorMessage":"fzf not found – install it for fuzzy selection","messagePattern":"fzf not found – install it for fuzzy selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ai.rs","lineNumber":13409,"sourceCode":"                    truncate_str(&summary_clean, 60),\n                    id_short\n                )\n            };\n\n            entries.push(FzfSessionEntry {\n                display,\n                session_id: session.session_id.clone(),\n                provider: session.provider,\n            });\n        }\n\n        if entries.is_empty() {\n            println!(\"No sessions available.\");\n            return Ok(());\n        }\n\n        if which::which(\"fzf\").is_err() {\n            bail!(\"fzf not found – install it for fuzzy selection\");\n        }\n\n        let Some(selected) = run_session_fzf(&entries)? else {\n            return Ok(());\n        };\n\n        (selected.session_id.clone(), selected.provider)\n    };\n\n    // Read and format the session history\n    let history = read_session_history(&session_id, session_provider)?;\n\n    // Copy to clipboard\n    copy_to_clipboard(&history)?;\n\n    let line_count = history.lines().count();\n    println!(\"Copied session history ({} lines) to clipboard\", line_count);\n","sourceCodeStart":13391,"sourceCodeEnd":13427,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/ai.rs#L13391-L13427","documentation":"This error is thrown by a session-picking command (fzf-based fuzzy session selector) in src/ai.rs when the external `fzf` binary cannot be located on the system PATH. The code checks `which::which(\"fzf\")` before attempting to pipe session entries into it, and bails early with an install hint. It is a hard precondition: without fzf the fuzzy selection feature cannot run at all.","triggerScenarios":"Invoking the session list/pick command (the function containing this bail) on a machine where `fzf` is not installed or not on PATH; running in a minimal container or CI environment that lacks fzf; fzf installed via a non-PATH method (e.g. only in a GUI app bundle).","commonSituations":"Fresh developer machines or dotfiles not yet set up; Docker images built from slim base images; Windows/WSL setups where fzf was installed only inside WSL or only on Windows; PATH broken in the shell that launched the tool.","solutions":["Install fzf: macOS `brew install fzf`, Debian/Ubuntu `apt install fzf`, Fedora `dnf install fzf`, Arch `pacman -S fzf`","Verify it is reachable: `which fzf` (or `fzf --version`) in the same shell/environment that runs the tool","If fzf is installed but not found, fix PATH (e.g. add ~/.fzf/bin or ~/.local/bin to PATH) or symlink it into a PATH directory","As a workaround, pass the session id directly if the command supports a non-interactive session argument"],"exampleFix":"// before (shell)\n$ myapp sessions pick\nError: fzf not found – install it for fuzzy selection\n// after (shell)\n$ brew install fzf   # or apt install fzf\n$ which fzf\n/usr/local/bin/fzf\n$ myapp sessions pick","handlingStrategy":"validation","validationCode":"use std::process::Command;\nfn fzf_available() -> bool {\n    Command::new(\"fzf\").arg(\"--version\").output()\n        .map(|o| o.status.success()).unwrap_or(false)\n}\nif !fzf_available() {\n    eprintln!(\"Install fzf first: brew install fzf / apt install fzf\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"match run_session_picker() {\n    Err(e) if e.to_string().contains(\"fzf not found\") => {\n        eprintln!(\"fzf missing; install it or pass --session <id> to skip fuzzy selection\");\n    }\n    Err(e) => eprintln!(\"session pick failed: {e}\"),\n    Ok(sel) => { /* use selection */ }\n}","preventionTips":["Add fzf to your base provisioning script/Dockerfile so every machine and container has it","Check `which fzf` in shell startup or CI setup steps before invoking selection commands","Prefer passing an explicit session id in non-interactive contexts (CI, scripts) to avoid the fzf dependency entirely"],"tags":["missing-binary","fzf","cli","dependency"],"backgroundTag":"missing-required-binary","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}