{"record":{"id":"269b674ae591768b","repo":"tonhowtf/omniget","slug":"wl-copy-not-found","errorCode":null,"errorMessage":"wl-copy not found","messagePattern":"wl-copy not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/clipboard.rs","lineNumber":126,"sourceCode":"        }\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(());\n    }\n\n    let uri_clone = uri.clone();\n    let wl_result = tokio::task::spawn_blocking(move || {\n        let mut child = match crate::core::process::std_command(\"wl-copy\")\n            .args([\"--type\", \"text/uri-list\"])\n            .stdin(std::process::Stdio::piped())\n            .spawn()\n        {\n            Ok(c) => c,\n            Err(_) => return Err(anyhow::anyhow!(\"wl-copy 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) = wl_result {\n        tracing::info!(\"[clipboard] copied file to clipboard (wl-copy): {}\", path);\n        return Ok(());","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/clipboard.rs#L108-L144","documentation":"On Wayland, copy_file_linux tries to spawn the wl-copy binary with MIME type text/uri-list to place a file URI on the clipboard. If wl-copy is not installed or cannot be spawned, the code immediately returns Err(\"wl-copy not found\"). This is an environment/dependency problem, not a code bug.","triggerScenarios":"Calling copy_file_to_clipboard on a Wayland/Linux system where the wl-clipboard package (providing wl-copy) is not installed, or the binary is not on PATH so std_command(\"wl-copy\").spawn() returns Err.","commonSituations":"Minimal Linux distributions or containers without wl-clipboard; CI environments with no Wayland session; users on X11-only systems running the wl-copy branch.","solutions":["Install the wl-clipboard package (e.g. `sudo apt install wl-clipboard` or `sudo dnf install wl-clipboard`).","Verify `which wl-copy` resolves and that a Wayland compositor session is running.","Ensure the code's fallback to xclip/xsel runs (the tool-choice logic should skip wl-copy when unavailable rather than hard-fail).","Bundle or document the wl-clipboard dependency in the app's installation instructions."],"exampleFix":"// before\nErr(_) => return Err(anyhow::anyhow!(\"wl-copy not found\")),\n\n// after\nErr(e) => {\n    tracing::warn!(\"[clipboard] wl-copy unavailable ({}), trying xclip\", e);\n    return copy_file_xclip(path).await;\n}","handlingStrategy":"fallback","validationCode":"fn wl_copy_available() -> bool {\n    std::process::Command::new(\"which\").arg(\"wl-copy\")\n        .output().map(|o| o.status.success()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"if wl_copy_available() {\n    copy_file_wl(path).await?;\n} else {\n    copy_file_xclip(path).await.or_else(|_| copy_file_xsel(path)).await?;\n}","preventionTips":["Install wl-clipboard on all Wayland target machines","Check PATH for wl-copy before choosing the Wayland branch","Document the wl-clipboard requirement in install instructions","Always keep an X11 fallback (xclip/xsel) enabled"],"tags":["clipboard","linux","wayland","missing-binary"],"backgroundTag":"missing-dependency","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"}