summaryrefslogtreecommitdiff
path: root/dev/tui
diff options
context:
space:
mode:
Diffstat (limited to 'dev/tui')
-rw-r--r--dev/tui/tui.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig
index c2f3dbf1..5b5c1e67 100644
--- a/dev/tui/tui.zig
+++ b/dev/tui/tui.zig
@@ -694,6 +694,22 @@ const Tty = struct {
return .{ .drew = t.sh.frames.bytes > 0, .moving = false };
}
+ /// What its view asked of this machine (client.zig `asks`): register
+ /// `+` to the terminal's clipboard (OSC 52), its clipboard asked for
+ /// (the answer comes back as a paste, `Shell.feed`), a link opened.
+ pub fn copy(t: *Tty, text: []const u8) void {
+ const sc = t.screen;
+ if (text.len > 0) sc.vx.copyToSystemClipboard(sc.tty.writer(), text, t.sh.gpa) catch {};
+ }
+
+ pub fn paste(t: *Tty, _: *Client) void {
+ t.screen.vx.requestSystemClipboard(t.screen.tty.writer()) catch {};
+ }
+
+ pub fn open(_: *Tty, url: []const u8) void {
+ look.openLink(url);
+ }
+
/// The session's stream, onto the loop.
pub fn said(t: *Tty, msg: replica.Said) bool {
t.loop.postEvent(.{ .said = msg }) catch return false;