{"record":{"id":"22f65da55f6aac11","repo":"Hmbown/CodeWhale","slug":"another-terminal-clipboard-write-is-still-queued","errorCode":null,"errorMessage":"another terminal clipboard write is still queued","messagePattern":"another terminal clipboard write is still queued","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/clipboard.rs","lineNumber":246,"sourceCode":"                        break;\n                    }\n                }\n            })\n            .context(\"spawn terminal clipboard writer\")?;\n        Ok(Self {\n            request_tx,\n            completion_rx,\n        })\n    }\n\n    fn enqueue(&self, text: &str, in_tmux: bool) -> Result<()> {\n        let request = TerminalClipboardWriteRequest {\n            text: text.to_string(),\n            in_tmux,\n        };\n        self.request_tx.try_send(request).map_err(|err| match err {\n            std::sync::mpsc::TrySendError::Full(_) => {\n                anyhow::anyhow!(\"another terminal clipboard write is still queued\")\n            }\n            std::sync::mpsc::TrySendError::Disconnected(_) => {\n                anyhow::anyhow!(\"terminal clipboard writer stopped\")\n            }\n        })\n    }\n\n    fn poll_completion(&self) -> Option<TerminalClipboardWriteCompletion> {\n        self.completion_rx.try_recv().ok()\n    }\n}\n\n/// Clipboard reader/writer helper.\npub struct ClipboardHandler {\n    terminal_context: TerminalClipboardContext,\n    terminal_writer: Option<TerminalClipboardWriter>,\n    #[cfg(any(\n        target_os = \"macos\",","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/clipboard.rs#L228-L264","documentation":"Back-pressure error from enqueue: the terminal clipboard writer's bounded mpsc request channel is already holding an unwritten clipboard write, so try_send returns TrySendError::Full and this write is rejected rather than silently dropped or blocking the TUI thread.","triggerScenarios":"Thrown at crates/tui/src/tui/clipboard.rs:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the previously queued clipboard write to complete (completion_rx) before enqueueing again.","Retry the clipboard write after a short delay; the queued write should drain quickly.","Use an OS-level clipboard fallback (e.g. OSC52 or a clipboard crate) if terminal writes must never be coalesced."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}