mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-04 12:54:41 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user