{"record":{"id":"30555aac2ae49dd9","repo":"gitui-org/gitui","slug":"command-e","errorCode":null,"errorMessage":"`{command:?}`: {e:?}","messagePattern":"`\\{command:\\?\\}`: \\{e:\\?\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/clipboard.rs","lineNumber":27,"sourceCode":"\targs: &[&str],\n\ttext: &str,\n\tpipe_stderr: bool,\n) -> Result<()> {\n\tlet binary = which(command)\n\t\t.ok()\n\t\t.unwrap_or_else(|| PathBuf::from(command));\n\n\tlet mut process = Command::new(binary)\n\t\t.args(args)\n\t\t.stdin(Stdio::piped())\n\t\t.stdout(Stdio::null())\n\t\t.stderr(if pipe_stderr {\n\t\t\tStdio::piped()\n\t\t} else {\n\t\t\tStdio::null()\n\t\t})\n\t\t.spawn()\n\t\t.map_err(|e| anyhow!(\"`{command:?}`: {e:?}\"))?;\n\n\tprocess\n\t\t.stdin\n\t\t.as_mut()\n\t\t.ok_or_else(|| anyhow!(\"`{command:?}`\"))?\n\t\t.write_all(text.as_bytes())\n\t\t.map_err(|e| anyhow!(\"`{command:?}`: {e:?}\"))?;\n\n\tlet out = process\n\t\t.wait_with_output()\n\t\t.map_err(|e| anyhow!(\"`{command:?}`: {e:?}\"))?;\n\n\tif out.status.success() {\n\t\tOk(())\n\t} else {\n\t\tlet msg = if out.stderr.is_empty() {\n\t\t\tformat!(\"{}\", out.status).into()\n\t\t} else {","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/gitui-org/gitui/blob/2fa693cb6ed431b21ebc300dd02e83c2476699ce/src/clipboard.rs#L9-L45","documentation":"gitui has no built-in clipboard: copy operations shell out to an external provider (wl-copy/wl-paste on Wayland, xclip, xsel, pbcopy, clip.exe, win32yank, or termux-clipboard-set depending on platform/session). exec_copy_with_args() resolves the binary with the which crate and spawns it; this error is that spawn failing at the OS level - overwhelmingly ErrorKind::NotFound (provider not installed or not on PATH) or PermissionDenied. The message embeds the full command line and the debug form of the io::Error.","triggerScenarios":"Pressing the copy key (e.g. y on a commit or file) when no clipboard tool is installed; being on Wayland with only xclip installed or X11 with only wl-clipboard; running gitui over plain ssh where the remote lacks any provider; a PATH entry where the binary exists but is not executable.","commonSituations":"Minimal tiling-WM or server installs without xclip/wl-clipboard; ssh sessions into remote hosts; WSL with interop disabled so clip.exe is unreachable; NixOS/Arch systems where the clipboard package was never added.","solutions":["Install the provider matching your session: xclip or xsel (X11), wl-clipboard (Wayland), pbcopy (ships with macOS), win32yank or re-enabled interop for clip.exe (Windows/WSL), termux-api (Termux).","Verify from the same shell/environment gitui runs in: echo test | xclip -selection clipboard (or | wl-copy) must succeed.","Check the session variables are exported where gitui inherits them: echo $DISPLAY and echo $WAYLAND_DISPLAY.","In ssh sessions, forward X (ssh -X) or run inside tmux with a terminal that supports OSC 52 clipboard escapes."],"exampleFix":"# Debian/Ubuntu, X11\n# before: gitui copy -> `\"xclip -selection clipboard\": Os { code: 2, kind: NotFound, ... }`\nsudo apt install xclip\n# after: copy works\n\n# Arch + Wayland\nsudo pacman -S wl-clipboard","handlingStrategy":"validation","validationCode":"# shell: confirm a provider exists in the exact session gitui runs in\ncommand -v xclip xsel wl-copy pbcopy clip.exe win32yank termux-clipboard-set 2>/dev/null\n\n// Rust: cheap availability probe before spawning\nuse std::process::Command;\nfn provider_available(cmd: &str) -> bool {\n    let bin = cmd.split_whitespace().next().unwrap_or(\"\");\n    Command::new(bin).arg(\"--version\")\n        .stdout(std::process::Stdio::null())\n        .stderr(std::process::Stdio::null())\n        .status().is_ok()\n}","typeGuard":null,"tryCatchPattern":"match copy(text) {\n    Err(e) if e.to_string().contains(\"NotFound\") => { /* disable copy UI / inform user */ Ok(()) }\n    other => other,\n}","preventionTips":["Install xclip or wl-clipboard as part of your desktop baseline.","Check clipboard tooling in the same ssh/tmux context you launch TUIs from.","Treat clipboard as best-effort: catch and degrade instead of letting it bubble into the UI."],"tags":["clipboard","subprocess","spawn","not-found","wayland","x11","external-tool"],"backgroundTag":"command-not-found","analyzedSha":"2fa693cb6ed431b21ebc300dd02e83c2476699ce","analyzedAt":"2026-08-16T23:07:36.562Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}