diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-03-14 15:09:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-14 15:09:10 +0000 |
commit | ead8d68c69914c2d391165da43ffd8bb0e35a9a5 (patch) | |
tree | c635f2c6bee4af07eb000edceb81d7f6f8f770bc /alacritty_terminal/src/ansi.rs | |
parent | d20051b5e5a8ee3c8dcd75a87d375ac7611a9d2d (diff) | |
download | alacritty-ead8d68c69914c2d391165da43ffd8bb0e35a9a5.tar.gz alacritty-ead8d68c69914c2d391165da43ffd8bb0e35a9a5.zip |
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.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 1c1c7cd5..a5f8564b 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -154,7 +154,7 @@ pub trait TermInfo { /// writing specific handler impls for tests far easier. pub trait Handler { /// OSC to set window title - fn set_title(&mut self, _: &str) {} + fn set_title(&mut self, _: Option<String>) {} /// Set the cursor style fn set_cursor_style(&mut self, _: Option<CursorStyle>) {} @@ -771,8 +771,10 @@ where .iter() .flat_map(|x| str::from_utf8(x)) .collect::<Vec<&str>>() - .join(";"); - self.handler.set_title(&title); + .join(";") + .trim() + .to_owned(); + self.handler.set_title(Some(title)); return; } unhandled(params); |