aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorLiu Wei <liuw@liuw.name>2017-08-29 17:32:08 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-08-29 09:32:08 -0700
commitb38d825921ac20d9f6543c23ed3bc0a44a0bdf2d (patch)
tree226a3e48f82392933ee218efc336b08aa71c43b8 /src/main.rs
parent6495ab34d2043440f138242cf58d39e687e6c02e (diff)
downloadalacritty-b38d825921ac20d9f6543c23ed3bc0a44a0bdf2d.tar.gz
alacritty-b38d825921ac20d9f6543c23ed3bc0a44a0bdf2d.zip
Implement options to not start the config_monitor thread (#689)
Provide a command line option as well as a configuration file option. The command line option takes precedence.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 472e4144..b8b82914 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -148,8 +148,15 @@ fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> {
//
// The monitor watches the config file for changes and reloads it. Pending
// config changes are processed in the main loop.
- let config_monitor = config.path()
- .map(|path| config::Monitor::new(path, display.notifier()));
+ let config_monitor = match (options.live_config_reload, config.live_config_reload()) {
+ // Start monitor if CLI flag says yes
+ (Some(true), _) |
+ // Or if no CLI flag was passed and the config says yes
+ (None, true) => config.path()
+ .map(|path| config::Monitor::new(path, display.notifier())),
+ // Otherwise, don't start the monitor
+ _ => None,
+ };
// Kick off the I/O thread
let io_thread = event_loop.spawn(None);