From f63b8863d1411ec95cc51ade11e4d8dc0806ecc3 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 3 Jan 2025 14:32:20 +0100 Subject: [PATCH] fix: add pretty error if clipboard request is denied by terminal closes #97 --- src/tui/tui.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tui/tui.zig b/src/tui/tui.zig index be9945e..e8b5758 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -312,6 +312,9 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void { command.executeName("paste", command.fmt(.{text})); } + if (try m.match(.{ "system_clipboard", tp.null_ })) + return self.logger.err_msg("clipboard", "clipboard request denied or empty"); + if (try m.match(.{"render"})) { self.render_pending = false; if (!self.frame_clock_running)