From cb4d2c0a3b20adc4c0603dcfb9447e9ebf72eae5 Mon Sep 17 00:00:00 2001 From: Christian Dürr Date: Fri, 16 Nov 2018 11:13:38 +0100 Subject: Add option for keeping log files 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 --- src/config.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/config.rs') 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, @@ -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>(path: P) -> Result { let path = path.into(); let raw = Config::read_file(path.as_path())?; -- cgit v1.2.3-54-g00ecf