diff options
author | Wesley Gahr <wesleyey0408@gmail.com> | 2017-12-24 19:24:28 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-24 10:24:28 -0800 |
commit | ed91eb365e8e24b0ef64351235ab3f8022a8e7b3 (patch) | |
tree | 75e36a347fd48595486ca2e059934aad55e14855 /src/config.rs | |
parent | 4fb2109497daddcc2f2f855f23073a4aa699463a (diff) | |
download | alacritty-ed91eb365e8e24b0ef64351235ab3f8022a8e7b3.tar.gz alacritty-ed91eb365e8e24b0ef64351235ab3f8022a8e7b3.zip |
Adding dynamic_title property to configuration (#819)
This logic is applied in Term's ansi::Handler implementation
to avoid unnecessary allocations.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 7d3fa16f..b941c882 100644 --- a/src/config.rs +++ b/src/config.rs @@ -307,6 +307,10 @@ pub struct Config { #[serde(default)] visual_bell: VisualBellConfig, + /// Use dynamic title + #[serde(default="true_bool")] + dynamic_title: bool, + /// Hide cursor when typing #[serde(default)] hide_cursor_when_typing: bool, @@ -371,6 +375,7 @@ impl Default for Config { env: Default::default(), hide_cursor_when_typing: Default::default(), cursor_style: Default::default(), + dynamic_title: Default::default(), live_config_reload: true, window: Default::default(), } @@ -1240,6 +1245,11 @@ impl Config { self.live_config_reload } + #[inline] + pub fn dynamic_title(&self) -> bool { + self.dynamic_title + } + pub fn load_from<P: Into<PathBuf>>(path: P) -> Result<Config> { let path = path.into(); let raw = Config::read_file(path.as_path())?; |