diff --git a/src/Surface.zig b/src/Surface.zig index 30235f26f..372da325a 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -4445,6 +4445,7 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool .copy_title_to_clipboard => { const title = self.rt_surface.getTitle() orelse return false; + if (title.len == 0) return false; self.rt_surface.setClipboardString(title, .standard, false) catch |err| { log.err("error copying title to clipboard err={}", .{err}); diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 21edf2636..f76da360a 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -282,7 +282,7 @@ pub const Action = union(enum) { copy_url_to_clipboard, /// Copy the terminal title to the clipboard. If the terminal title is not - /// set this has no effect. + /// set or is empty this has no effect. copy_title_to_clipboard, /// Increase the font size by the specified amount in points (pt).