{"record":{"id":"02a44257957e5f5f","repo":"tonhowtf/omniget","slug":"xsel-not-found","errorCode":null,"errorMessage":"xsel not found","messagePattern":"xsel not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/clipboard.rs","lineNumber":97,"sourceCode":"        }\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(());\n    }\n\n    let uri_clone = uri.clone();\n    let xsel_result = tokio::task::spawn_blocking(move || {\n        let mut child = match crate::core::process::std_command(\"xsel\")\n            .args([\"--clipboard\", \"--input\"])\n            .stdin(std::process::Stdio::piped())\n            .spawn()\n        {\n            Ok(c) => c,\n            Err(_) => return Err(anyhow::anyhow!(\"xsel 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) = xsel_result {\n        tracing::info!(\"[clipboard] copied file URI to clipboard (xsel): {}\", path);\n        return Ok(());","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/clipboard.rs#L79-L115","documentation":"If xclip failed on Linux, copy_file_linux falls back to xsel. When xsel also cannot be spawned (not installed), this 'xsel not found' error is returned — meaning neither clipboard utility is available.","triggerScenarios":"copy_file_to_clipboard on Linux where xclip already failed and the xsel fallback binary is also missing from PATH.","commonSituations":"Minimal or headless Linux systems with neither xclip nor xsel installed; Wayland sessions without XWayland where both X tools are absent.","solutions":["Install a clipboard tool: sudo apt install xclip (preferred) or sudo apt install xsel.","On Wayland, install wl-clipboard and check whether the app supports it, or run under XWayland.","Verify with 'which xclip xsel' and retry the copy."],"exampleFix":"// before\n$ which xclip xsel  # neither installed\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')) {\n  throw new Error('No clipboard tool found; run: sudo apt install xclip');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install at least one of xclip/xsel on all Linux images used with the app","Check for both binaries during app startup and show an install hint","Document the clipboard dependency in Linux setup docs"],"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"}