{"record":{"id":"d5558b452b988456","repo":"nikivdev/code","slug":"no-package-selected","errorCode":null,"errorMessage":"no package selected","messagePattern":"no package selected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/install.rs","lineNumber":588,"sourceCode":"            \"--with-nth=1,3\",\n            \"--prompt=flox> \",\n            \"--preview=echo Version: {2}\\\\n\\\\n{3}\",\n            \"--preview-window=right,60%,wrap\",\n        ])\n        .stdin(std::process::Stdio::piped())\n        .stdout(std::process::Stdio::piped())\n        .spawn()\n        .context(\"failed to spawn fzf\")?;\n\n    child\n        .stdin\n        .as_mut()\n        .context(\"failed to open fzf stdin\")?\n        .write_all(input.as_bytes())?;\n\n    let output = child.wait_with_output()?;\n    if !output.status.success() {\n        bail!(\"no package selected\");\n    }\n\n    let selection = String::from_utf8(output.stdout).context(\"fzf output was not valid UTF-8\")?;\n    let selected = selection.trim().split('\\t').next().unwrap_or(\"\");\n    if selected.is_empty() {\n        bail!(\"no package selected\");\n    }\n    Ok(selected.to_string())\n}\n\n#[derive(Clone, Debug, Deserialize)]\nstruct FloxSearchEntry {\n    #[serde(rename = \"pkg_path\")]\n    pkg_path: String,\n    description: Option<String>,\n    version: Option<String>,\n}\n","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/install.rs#L570-L606","documentation":"prompt_flox_package pipes the formatted search entries into fzf for interactive selection. If fzf exits with a non-zero status — most commonly because the user pressed Esc/Ctrl-C, or fzf failed to start properly — the function bails with 'no package selected'.","triggerScenarios":"fzf exits non-zero: user aborts selection, terminal lacks a TTY in scripted runs, or fzf is killed. Distinguished from the empty-selection case at line 594 which handles blank output with exit code 0.","commonSituations":"Running the installer non-interactively (CI, piped stdin) where fzf cannot present a UI; user cancels the picker; misconfigured fzf (FZF_DEFAULT_OPTS) causing non-zero exit.","solutions":["Select a package in the fzf UI instead of cancelling (Esc/Ctrl-C)","Run interactively in a real TTY rather than piping/capturing output","Check FZF_DEFAULT_OPTS or fzf wrapper scripts for flags causing non-zero exits","Handle the error upstream in run and surface a friendly 'cancelled' message"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure an interactive TTY before invoking the picker\nif !std::io::stdin().is_terminal() {\n    eprintln!(\"Interactive selection requires a TTY; pass a package name instead\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match prompt_flox_package() {\n    Err(e) if e.to_string() == \"no package selected\" => {\n        eprintln!(\"Selection cancelled by user\");\n        return Ok(()); // treat as benign cancel\n    }\n    other => other?,\n}","preventionTips":["Only invoke the picker in interactive TTY sessions","Accept a package name as a CLI argument to skip fzf entirely in scripts","Check FZF_DEFAULT_OPTS for flags that cause abnormal exits"],"tags":["fzf","cli","user-cancelled"],"backgroundTag":"fzf-selection-cancelled","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}