Skip to content

Commit 72ddeae

Browse files
authored
Merge pull request #503 from CortexLM/fix/linux-clipboard-error-logging
fix(tui): add error logging for Linux clipboard operations
2 parents 3eb88dd + e85cd06 commit 72ddeae

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cortex-tui/src/runner/event_loop.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10081,10 +10081,15 @@ impl EventLoop {
1008110081
#[cfg(target_os = "linux")]
1008210082
{
1008310083
// Spawn thread to avoid blocking UI - Linux clipboard needs to wait for manager
10084-
std::thread::spawn(move || {
10085-
if let Ok(mut clipboard) = arboard::Clipboard::new() {
10084+
std::thread::spawn(move || match arboard::Clipboard::new() {
10085+
Ok(mut clipboard) => {
1008610086
use arboard::SetExtLinux;
10087-
let _ = clipboard.set().wait().text(selected_text);
10087+
if let Err(e) = clipboard.set().wait().text(selected_text) {
10088+
tracing::warn!("Failed to copy to clipboard: {}", e);
10089+
}
10090+
}
10091+
Err(e) => {
10092+
tracing::warn!("Failed to access clipboard: {}", e);
1008810093
}
1008910094
});
1009010095
}

0 commit comments

Comments
 (0)