-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When running jdbrowser on a headless Linux server over SSH (no GUI, no X11), the application crashes with the following panic:
The application panicked (crashed).
Message: called `Result::unwrap()` on an `Err` value: Unknown { .. } - "Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable"
Location: src/ui/talbe_view.rs:141
📍 Cause
The code at src/ui/talbe_view.rs:141 unconditionally calls .unwrap() on Clipboard::new():
let clipboard = Clipboard::new().unwrap(); // Panics on headless systemsThis fails when there's no X11 environment available (e.g., server-only systems or SSH sessions without X forwarding).
✅ Suggested Fix
Gracefully handle clipboard initialization failures:
let clipboard = match Clipboard::new() {
Ok(cb) => Some(cb),
Err(e) => {
eprintln!("Clipboard init error: {e}");
None
}
};Later code should check if let Some(cb) = clipboard before usage.
💡 Optional
Add support for disabling clipboard via environment variable, e.g.:
if std::env::var("DISABLE_CLIPBOARD").is_ok() {
clipboard = None;
}And run with:
DISABLE_CLIPBOARD=1 jdbrowser🧪 Environment
- OS: Ubuntu 22.04 Server
- Access: SSH without GUI/X11
- Version: latest
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels