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,