From ead8d68c69914c2d391165da43ffd8bb0e35a9a5 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 14 Mar 2020 15:09:10 +0000 Subject: Fix live config reload for window title This enables live config reload for the window title. This includes updating the title after it has been pushed and popped from the title stack. The dynamic title option also isn't disabled automatically anymore when the title is set in the config. If the title is set from CLI, the behavior is unchanged and dynamic title changes are still disabled. If the dynamic title is disabled in the config, the title is still updated when the config title is changed. Dynamic title now only prevents changes to the UI's title. --- alacritty/src/cli.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 30f0938c..2137c9c8 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -272,6 +272,7 @@ impl Options { config.hold = self.hold; + config.set_dynamic_title(config.dynamic_title() && self.title.is_none()); config.window.dimensions = self.dimensions.unwrap_or(config.window.dimensions); config.window.title = self.title.unwrap_or(config.window.title); config.window.position = self.position.or(config.window.position); @@ -285,8 +286,6 @@ impl Options { } } - config.set_dynamic_title(config.dynamic_title() && config.window.title == DEFAULT_NAME); - config.debug.print_events = self.print_events || config.debug.print_events; config.debug.log_level = max(config.debug.log_level, self.log_level); config.debug.ref_test = self.ref_test || config.debug.ref_test; @@ -328,12 +327,12 @@ mod tests { } #[test] - fn dynamic_title_overridden_by_config() { + fn dynamic_title_not_overridden_by_config() { let mut config = Config::default(); config.window.title = "foo".to_owned(); let config = Options::default().into_config(config); - assert!(!config.dynamic_title()); + assert!(config.dynamic_title()); } } -- cgit