diff options
author | Dustin <dustin1114@gmail.com> | 2019-10-14 13:50:58 -0400 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-10-14 19:50:58 +0200 |
commit | 401c2aab964b60e8c3b072e5098ba8e366d04944 (patch) | |
tree | 8b8fb2f11a93ebb3e59dedb41e01a89f30791455 /alacritty_terminal/src/config | |
parent | 3475e449870b382cda4ea6d48f980577cd8c929e (diff) | |
download | alacritty-401c2aab964b60e8c3b072e5098ba8e366d04944.tar.gz alacritty-401c2aab964b60e8c3b072e5098ba8e366d04944.zip |
Add support for title stack escape sequences
This commit adds the concept of a "title stack" to the terminal. Some programs
(e.g. vim) send control sequences `CSI 22 ; 0` (push title) and `CSI 23 ; 0`
(pop title).
The title stack is just a history of previous titles. Applications can push
the current title onto the stack, and pop it back off (setting the window title
in the process).
Fixes #2840.
Diffstat (limited to 'alacritty_terminal/src/config')
-rw-r--r-- | alacritty_terminal/src/config/window.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/alacritty_terminal/src/config/window.rs b/alacritty_terminal/src/config/window.rs index f470f936..49bd70bb 100644 --- a/alacritty_terminal/src/config/window.rs +++ b/alacritty_terminal/src/config/window.rs @@ -36,8 +36,8 @@ pub struct WindowConfig { startup_mode: StartupMode, /// Window title - #[serde(deserialize_with = "failure_default")] - pub title: Option<String>, + #[serde(default = "default_title")] + pub title: String, /// Window class #[serde(deserialize_with = "from_string_or_deserialize")] @@ -56,6 +56,10 @@ pub struct WindowConfig { pub start_maximized: Option<bool>, } +pub fn default_title() -> String { + DEFAULT_NAME.to_string() +} + impl WindowConfig { pub fn startup_mode(&self) -> StartupMode { match self.start_maximized { |