{"record":{"id":"71fdfa578560dd02","repo":"sxyazi/yazi","slug":"chafa-returned-no-output","errorCode":null,"errorMessage":"chafa returned no output","messagePattern":"chafa returned no output","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-adapter/src/drivers/chafa.rs","lineNumber":46,"sourceCode":"\t\t\t\t\"none\",\n\t\t\t\t\"--animate\",\n\t\t\t\t\"off\",\n\t\t\t\t\"--view-size\",\n\t\t\t])\n\t\t\t.arg(format!(\"{}x{}\", max.width, max.height))\n\t\t\t.arg(path)\n\t\t\t.stdin(Stdio::null())\n\t\t\t.stdout(Stdio::piped())\n\t\t\t.stderr(Stdio::null())\n\t\t\t.kill_on_drop(true)\n\t\t\t.spawn()\n\t\t\t.map_err(|e| anyhow!(\"failed to spawn chafa: {e}\"))?;\n\n\t\tlet output = child.wait_with_output().await?;\n\t\tif !output.status.success() {\n\t\t\tbail!(\"chafa failed with status: {}\", output.status);\n\t\t} else if output.stdout.is_empty() {\n\t\t\tbail!(\"chafa returned no output\");\n\t\t}\n\n\t\tlet lines: Vec<_> = output.stdout.split(|&b| b == b'\\n').collect();\n\t\tlet Ok(Some(first)) = lines[0].to_text().map(|mut t| t.lines.pop()) else {\n\t\t\tbail!(\"failed to parse chafa output\");\n\t\t};\n\n\t\tlet area = Rect {\n\t\t\tx:      max.x,\n\t\t\ty:      max.y,\n\t\t\twidth:  first.width() as u16,\n\t\t\theight: lines.len() as u16,\n\t\t};\n\n\t\tADAPTOR.image_hide()?;\n\t\tADAPTOR.shown_store(area);\n\t\tEmulator::move_lock((max.x, max.y), |w| {\n\t\t\tfor (i, line) in lines.into_iter().enumerate() {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-adapter/src/drivers/chafa.rs#L28-L64","documentation":"The chafa process exited successfully (status 0) but wrote zero bytes to stdout, so there is no graphic to pass through to the terminal. Since stderr is piped to null and animation is off, this typically means chafa silently produced nothing for the given image path or view size rather than reporting an error.","triggerScenarios":"Thrown at yazi-adapter/src/drivers/chafa.rs:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the image file at `path` is a valid, non-empty image that chafa can decode.","Ensure the `--view-size` dimensions passed (`max.width x max.height`) are non-zero and sane.","Run chafa manually on the same file and arguments to see what it reports on stderr, which the code discards.","Fall back to another image preview adapter or skip the preview when chafa yields no output."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}