fix: copy_title_to_clipboard now respects user-overridden title

When a user renames a surface via "Change Terminal Title" and then
uses copy_title_to_clipboard, the raw terminal title was copied
instead of the custom name.

This adds a new `copy_title` apprt action so each platform resolves
the effective title (user override or terminal-set) before copying
to clipboard.

Fixes #10345
This commit is contained in:
Priyanshu
2026-02-13 01:19:15 +05:30
parent 13e8d85a01
commit b4be13ed50
6 changed files with 57 additions and 14 deletions

View File

@@ -5398,20 +5398,11 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
return false;
},
.copy_title_to_clipboard => {
const title = self.rt_surface.getTitle() orelse return false;
if (title.len == 0) return false;
self.rt_surface.setClipboard(.standard, &.{.{
.mime = "text/plain",
.data = title,
}}, false) catch |err| {
log.err("error copying title to clipboard err={}", .{err});
return true;
};
return true;
},
.copy_title_to_clipboard => return try self.rt_app.performAction(
.{ .surface = self },
.copy_title,
{},
),
.paste_from_clipboard => return try self.startClipboardRequest(
.standard,