mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-17 07:16:12 +00:00
Add tab title rename feature to macos
This commit is contained in:

committed by
Mitchell Hashimoto

parent
228b4dbd60
commit
a581955b9b
@@ -4024,6 +4024,12 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
try self.setFontSize(size);
|
||||
},
|
||||
|
||||
.prompt_surface_title => return try self.rt_app.performAction(
|
||||
.{ .surface = self },
|
||||
.prompt_title,
|
||||
{},
|
||||
),
|
||||
|
||||
.clear_screen => {
|
||||
// This is a duplicate of some of the logic in termio.clearScreen
|
||||
// but we need to do this here so we can know the answer before
|
||||
|
@@ -158,9 +158,13 @@ pub const Action = union(Key) {
|
||||
/// Show a desktop notification.
|
||||
desktop_notification: DesktopNotification,
|
||||
|
||||
/// Set the title of the target.
|
||||
/// Set the title of the target to the requested value.
|
||||
set_title: SetTitle,
|
||||
|
||||
/// Set the title of the target to a prompted value. It is up to
|
||||
/// the apprt to prompt.
|
||||
prompt_title,
|
||||
|
||||
/// The current working directory has changed for the target terminal.
|
||||
pwd: Pwd,
|
||||
|
||||
@@ -254,6 +258,7 @@ pub const Action = union(Key) {
|
||||
render_inspector,
|
||||
desktop_notification,
|
||||
set_title,
|
||||
prompt_title,
|
||||
pwd,
|
||||
mouse_shape,
|
||||
mouse_visibility,
|
||||
|
@@ -239,6 +239,7 @@ pub const App = struct {
|
||||
.pwd,
|
||||
.config_change,
|
||||
.toggle_maximize,
|
||||
.prompt_title,
|
||||
=> {
|
||||
log.info("unimplemented action={}", .{action});
|
||||
return false;
|
||||
|
@@ -560,6 +560,7 @@ pub fn performAction(
|
||||
.render_inspector,
|
||||
.renderer_health,
|
||||
.color_change,
|
||||
.prompt_title,
|
||||
=> {
|
||||
log.warn("unimplemented action={}", .{action});
|
||||
return false;
|
||||
|
@@ -348,6 +348,10 @@ pub const Action = union(enum) {
|
||||
/// This only works with libadwaita enabled currently.
|
||||
toggle_tab_overview: void,
|
||||
|
||||
/// Change the title of the current focused surface via a prompt.
|
||||
/// This only works on macOS currently.
|
||||
prompt_surface_title: void,
|
||||
|
||||
/// Create a new split in the given direction.
|
||||
///
|
||||
/// Arguments:
|
||||
@@ -748,6 +752,7 @@ pub const Action = union(enum) {
|
||||
.increase_font_size,
|
||||
.decrease_font_size,
|
||||
.reset_font_size,
|
||||
.prompt_surface_title,
|
||||
.clear_screen,
|
||||
.select_all,
|
||||
.scroll_to_top,
|
||||
|
Reference in New Issue
Block a user