diff options
author | Christian Dürr <contact@christianduerr.com> | 2018-11-16 11:13:38 +0100 |
---|---|---|
committer | Christian Dürr <contact@christianduerr.com> | 2018-11-16 11:13:38 +0100 |
commit | cb4d2c0a3b20adc4c0603dcfb9447e9ebf72eae5 (patch) | |
tree | 0dc4d8c62882e70a583c01770607ce3c47944048 /src/config.rs | |
parent | e66f23ad97c8df42192d07650109d42de3c767c9 (diff) | |
download | alacritty-cb4d2c0a3b20adc4c0603dcfb9447e9ebf72eae5.tar.gz alacritty-cb4d2c0a3b20adc4c0603dcfb9447e9ebf72eae5.zip |
Add option for keeping log filesdisplay-config-errors
Since it's not unusual to spawn a lot of different terminal emulators
without restarting, Alacritty can create a ton of different log files.
To combat this problem, logfiles are now removed by default after
Alacritty has been closed. If the user wants to persist the log of a
single session, the `--persistent_logging` option can be used. For
persisting all log files, the `persistent_logging` option can be set in
the configuration file
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 1837cdf1..8e680ebe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -494,6 +494,10 @@ pub struct Config { #[serde(default, deserialize_with="failure_default")] cursor: Cursor, + /// Keep the log file after quitting + #[serde(default, deserialize_with="failure_default")] + persistent_logging: bool, + // TODO: DEPRECATED #[serde(default, deserialize_with = "failure_default")] custom_cursor_colors: Option<bool>, @@ -1662,6 +1666,12 @@ impl Config { self.scrolling.history = history; } + /// Keep the log file after quitting Alacritty + #[inline] + pub fn persistent_logging(&self) -> bool { + self.persistent_logging + } + pub fn load_from<P: Into<PathBuf>>(path: P) -> Result<Config> { let path = path.into(); let raw = Config::read_file(path.as_path())?; |