{"record":{"id":"d1e3c9c25dbb4aef","repo":"nikivdev/code","slug":"clipboard-not-supported-on-this-platform-d1e3c9","errorCode":null,"errorMessage":"clipboard not supported on this platform","messagePattern":"clipboard not supported on this platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":7493,"sourceCode":"            Err(_) => Command::new(\"xsel\")\n                .arg(\"--clipboard\")\n                .arg(\"--input\")\n                .stdin(Stdio::piped())\n                .spawn()\n                .context(\"failed to spawn xclip or xsel\")?,\n        };\n\n        if let Some(stdin) = child.stdin.as_mut() {\n            stdin.write_all(text.as_bytes())?;\n        }\n\n        child.wait()?;\n        return Ok(true);\n    }\n\n    #[cfg(not(any(target_os = \"macos\", target_os = \"linux\")))]\n    {\n        bail!(\"clipboard not supported on this platform\");\n    }\n}\n\nfn build_review_prompt_payload(\n    repo_root: &Path,\n    entry: &CommitQueueEntry,\n    report_path: Option<&Path>,\n) -> String {\n    let (branch_other, total_other, current_branch) = queued_review_counts_excluding(\n        repo_root,\n        &entry.commit_sha,\n    )\n    .unwrap_or((0, 0, \"unknown\".to_string()));\n    let mut out = String::new();\n    out.push_str(\"here is commit i want you to address fully\\n\\n\");\n    out.push_str(&format!(\n        \"Repo: {}\\nBranch: {}\\nQueued commit: {}\",\n        repo_root.display(),","sourceCodeStart":7475,"sourceCodeEnd":7511,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L7475-L7511","documentation":"The copy-to-clipboard helper supports macOS (pbcopy) and Linux (xclip/xsel). On any other target OS the compile-time cfg block has no implementation, so it unconditionally throws 'clipboard not supported on this platform'. It is a platform-support limitation, not a runtime misconfiguration.","triggerScenarios":"Invoking the clipboard-copy feature (e.g. copying a commit message/review link) on Windows, BSD, or any OS other than macOS or Linux.","commonSituations":"Running the tool on Windows (native or under some non-WSL environment), or cross-compiling/running in environments without a clipboard server (headless Linux without X11 also fails earlier at the xclip/xsel spawn step).","solutions":["Copy the text manually from the tool's printed output","Run under WSL with clipboard bridging or an X server providing xclip/xsel","Patch the helper to add support for your platform (e.g. `clip.exe` on Windows via /mnt/c/Windows/System32/clip.exe)","File/await an upstream feature request for Windows clipboard support"],"exampleFix":"// before\n#[cfg(not(any(target_os = \"macos\", target_os = \"linux\")))]\n{\n    bail!(\"clipboard not supported on this platform\");\n}\n// after\n#[cfg(target_os = \"windows\")]\n{\n    let mut child = Command::new(\"C:\\\\Windows\\\\System32\\\\clip.exe\")\n        .stdin(Stdio::piped()).spawn()?;\n    child.stdin.as_mut().unwrap().write_all(text.as_bytes())?;\n    child.wait()?;\n    return Ok(true);\n}\n#[cfg(not(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\")))]\n{\n    bail!(\"clipboard not supported on this platform\");\n}","handlingStrategy":"fallback","validationCode":"#[cfg(any(target_os = \"macos\", target_os = \"linux\"))]\nlet clipboard_ok = true;\n#[cfg(not(any(target_os = \"macos\", target_os = \"linux\")))]\nlet clipboard_ok = false;\nif !clipboard_ok { eprintln!(\"clipboard unavailable; printing text instead\"); }","typeGuard":"fn clipboard_supported() -> bool {\n    cfg!(any(target_os = \"macos\", target_os = \"linux\"))\n}","tryCatchPattern":"match tool.copy_to_clipboard(text) {\n    Err(e) if e.to_string().contains(\"clipboard not supported\") => {\n        println!(\"{}\", text); // print instead of copying\n    }\n    other => other?,\n}","preventionTips":["Feature-detect the platform (cfg! or std::env::consts::OS) before offering copy","Provide a print/stdout fallback for the same content","On Windows/WSL, bridge to clip.exe or powershell Set-Clipboard","Document platform support in tool output"],"tags":["platform","clipboard","unsupported"],"backgroundTag":"platform-not-supported","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}