From 2e016872058c1fbb2a5a9160d154c96b385ac5c0 Mon Sep 17 00:00:00 2001 From: onysd Date: Tue, 28 Jul 2026 06:01:30 +0300 Subject: [PATCH] fix --- tui-panel/server-panel.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tui-panel/server-panel.py b/tui-panel/server-panel.py index bc736955..f8e37eaa 100644 --- a/tui-panel/server-panel.py +++ b/tui-panel/server-panel.py @@ -828,8 +828,18 @@ class MainScreen(Screen): def _handle_copy_click(self, widget: CopyButton) -> None: if copy_to_clipboard(widget.value): self.notify(f"{widget.label} copied to clipboard") - else: - self.notify(f"{widget.label} copy failed", severity="warning") + return + # No local clipboard tool worked -- typically means this is a + # headless remote server (e.g. reached over SSH), where + # xclip/xsel/wl-copy have no X/Wayland display to talk to even if + # they happen to be installed. Fall back to OSC 52: a terminal + # escape sequence that most modern terminal emulators (Windows + # Terminal, iTerm2, kitty, alacritty, WezTerm, ...) intercept and + # copy straight into the *local* client's clipboard, even across + # SSH. There's no way to confirm from here whether the terminal + # actually supports it, so the message says "sent", not "copied". + self.app.copy_to_clipboard(widget.value) + self.notify(f"{widget.label} sent to terminal clipboard (OSC 52) -- works if your terminal supports it") def on_mount(self) -> None: self.query_one("#services-table", DataTable).add_columns("Service", "Type", "Status")