From 3f466b1fc3b51534f420c0f287447ca5eb6044cd Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 30 Sep 2020 08:47:41 -0700 Subject: [PATCH] wezterm: add automatically_reload_config=false option closes: https://github.com/wez/wezterm/issues/287 --- docs/changelog.markdown | 4 ++++ src/config/mod.rs | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/changelog.markdown b/docs/changelog.markdown index dd1699319..2e50e7bbb 100644 --- a/docs/changelog.markdown +++ b/docs/changelog.markdown @@ -30,6 +30,10 @@ brief notes about them may accumulate here. * We now bundle JetBrains Mono and use it as the default font, and add it as a default fallback font. Similarly, we also bundle Noto Color Emoji as a default fallback for emoji. +* Added `automatically_reload_config=false` option to disable + automatic config reloading. When set to false, you will need + to manually trigger a config reload (default: `SUPER+R` or + `CTRL+SHIFT+R`) ### 20200909-002054-4c9af461 diff --git a/src/config/mod.rs b/src/config/mod.rs index 442fc5076..ae47688f4 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -160,8 +160,10 @@ impl ConfigInner { self.error.take(); self.generation += 1; log::debug!("Reloaded configuration! generation={}", self.generation); - if let Some(path) = path { - self.watch_path(path); + if self.config.automatically_reload_config { + if let Some(path) = path { + self.watch_path(path); + } } } Err(err) => { @@ -539,6 +541,11 @@ pub struct Config { #[serde(default)] pub launch_menu: Vec, + /// When true, watch the config file and reload it automatically + /// when it is detected as changing. + #[serde(default = "default_true")] + pub automatically_reload_config: bool, + #[serde(default = "default_true")] pub add_wsl_distributions_to_launch_menu: bool,