{"record":{"id":"fd7ed1baaecd3409","repo":"tonhowtf/omniget","slug":"xclip-not-found","errorCode":null,"errorMessage":"xclip not found","messagePattern":"xclip not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/clipboard.rs","lineNumber":68,"sourceCode":"    }\n\n    tracing::info!(\"[clipboard] copied file to clipboard (macOS)\");\n    Ok(())\n}\n\n#[cfg(target_os = \"linux\")]\nasync fn copy_file_linux(path: &str) -> anyhow::Result<()> {\n    let uri = format!(\"file://{}\", path);\n\n    let uri_clone = uri.clone();\n    let xclip_result = tokio::task::spawn_blocking(move || {\n        let mut child = match crate::core::process::std_command(\"xclip\")\n            .args([\"-selection\", \"clipboard\", \"-target\", \"text/uri-list\"])\n            .stdin(std::process::Stdio::piped())\n            .spawn()\n        {\n            Ok(c) => c,\n            Err(_) => return Err(anyhow::anyhow!(\"xclip not found\")),\n        };\n        if let Some(ref mut stdin) = child.stdin {\n            use std::io::Write;\n            let _ = stdin.write_all(uri_clone.as_bytes());\n        }\n        let output = child.wait_with_output()?;\n        if output.status.success() {\n            Ok(true)\n        } else {\n            Ok(false)\n        }\n    })\n    .await\n    .map_err(|e| anyhow::anyhow!(\"{}\", e))?;\n\n    if let Ok(true) = xclip_result {\n        tracing::info!(\"[clipboard] copied file to clipboard (xclip): {}\", path);\n        return Ok(());","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/clipboard.rs#L50-L86","documentation":"On Linux, copy_file_linux first tries xclip to place the file URI on the clipboard. If the xclip process cannot be spawned (binary absent or not executable), the spawn error is swallowed and replaced with this 'xclip not found' error.","triggerScenarios":"copy_file_to_clipboard on a Linux/X11 system where the xclip binary is not installed in PATH.","commonSituations":"Minimal Linux installs or Wayland-only sessions without X clipboard tools; containers and servers without xclip; fresh distros missing xclip package.","solutions":["Install xclip: sudo apt install xclip (Debian/Ubuntu) or sudo dnf install xclip (Fedora).","On Wayland, note xclip needs XWayland; alternatively ensure xsel is installed so the fallback path works.","Verify with 'which xclip' before retrying the copy."],"exampleFix":"// before\n$ omniget copy-file report.pdf  # xclip not found\n// after\n$ sudo apt install xclip\n$ omniget copy-file report.pdf","handlingStrategy":"validation","validationCode":"const which = (bin) => { try { return require('child_process').execSync(`which ${bin}`).toString().trim(); } catch { return null; } };\nif (!which('xclip') && !which('xsel')) throw new Error('Install xclip or xsel for clipboard support');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision xclip in installation scripts for Linux targets","Detect the missing binary at startup and tell users which package to install","On Wayland deployments, verify XWayland is enabled"],"tags":["linux","clipboard","dependency"],"backgroundTag":"command-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}