fix: clipboard auto-detect had no macOS/Windows fallback, failed silently

copy_auto only ever tried wl-copy/xclip, so on macOS or Windows it
always returned false with no clipboard tool attempted. Added
pbcopy/clip fallbacks per-OS. Also, the detail-pane 'y'/'u' handlers
showed a status message only on success — a failed copy (no tool
found) looked like nothing happened at all; both now report the
outcome either way.
This commit is contained in:
dualfroz committed 2026-07-23 07:25:08 +02:00
1 parent cd4e8e92ea
commit edf4bd34bf
2 files changed
+26 -5

No files matched your search

+10 -2
View File
@@ -495,11 +495,19 @@ pub fn handle_key(code: KeyCode, st: &mut St) {
KeyCode::Char('o') => { st.run_action = Some(106); }
KeyCode::Char('y') => {
let path = st.summary.path.to_string_lossy().to_string();
if copy_to_clipboard(&path) { st.status_msg = Some("Path copied!".into()); }
st.status_msg = Some(if copy_to_clipboard(&path) {
"Path copied!".into()
} else {
format!("No clipboard tool found — path: {}", path)
});
}
KeyCode::Char('u') => {
if let Some(ref url) = st.remote_url_str.clone() {
if copy_to_clipboard(url) { st.status_msg = Some("URL copied!".into()); }
st.status_msg = Some(if copy_to_clipboard(url) {
"URL copied!".into()
} else {
format!("No clipboard tool found — URL: {}", url)
});
}
}
KeyCode::Char('g') => {