summaryrefslogtreecommitdiff
path: root/src/Surface.zig
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2025-07-06 12:12:27 -0500
committerJeffrey C. Ollie <jeff@ocjtech.us>2025-07-06 12:12:27 -0500
commit3cf56b8af3d5766210bc25202d0f82e15ce0ce6d (patch)
treeba4d777d01b4be098de308223323636b97b4869d /src/Surface.zig
parentd790b0f60e8016237a69dfdb284841392e4e4166 (diff)
keybind: add copy_title action
Fixes #7829 This will copy the terminal title to the clipboard. If the terminal title is not set it has no effect.
Diffstat (limited to 'src/Surface.zig')
-rw-r--r--src/Surface.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Surface.zig b/src/Surface.zig
index d9d6a3012..faba60ced 100644
--- a/src/Surface.zig
+++ b/src/Surface.zig
@@ -4443,6 +4443,17 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
return false;
},
+ .copy_title => {
+ const title = self.rt_surface.getTitle() orelse return false;
+
+ self.rt_surface.setClipboardString(title, .standard, false) catch |err| {
+ log.err("error copying title to clipboard err={}", .{err});
+ return true;
+ };
+
+ return true;
+ },
+
.paste_from_clipboard => try self.startClipboardRequest(
.standard,
.{ .paste = {} },