config: title can reload at runtime (#2906)

Related to #2898
This commit is contained in:
Mitchell Hashimoto
2024-12-08 11:27:15 -08:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@ -1182,6 +1182,14 @@ pub fn updateConfig(
log.warn("failed to notify renderer of config change err={}", .{err});
};
// If we have a title set then we update our window to have the
// newly configured title.
if (config.title) |title| try self.rt_app.performAction(
.{ .surface = self },
.set_title,
.{ .title = title },
);
// Notify the window
try self.rt_app.performAction(
.{ .surface = self },

View File

@ -679,6 +679,12 @@ fullscreen: bool = false,
/// The title Ghostty will use for the window. This will force the title of the
/// window to be this title at all times and Ghostty will ignore any set title
/// escape sequences programs (such as Neovim) may send.
///
/// This configuration can be reloaded at runtime. If it is set, the title
/// will update for all windows. If it is unset, the next title change escape
/// sequence will be honored but previous changes will not retroactively
/// be set. This latter case may require you restart programs such as neovim
/// to get the new title.
title: ?[:0]const u8 = null,
/// The setting that will change the application class value.