From c8e4f366e740b98377bf6faf157af358b3bc70d2 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Wed, 19 Jul 2017 12:26:45 -0700 Subject: [PATCH] Canonicalize the config watching path (#672) This should resolve an issue where config behind a symlink was not being properly reloaded when edited. --- src/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 7734e7af..e4f17ae7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1410,9 +1410,10 @@ impl Monitor { _thread: ::util::thread::spawn_named("config watcher", move || { let (tx, rx) = mpsc::channel(); let mut watcher = FileWatcher::new(tx).unwrap(); - watcher.watch(&path).expect("watch alacritty yml"); + let config_path = ::std::fs::canonicalize(path) + .expect("canonicalize config path"); - let config_path = path.as_path(); + watcher.watch(&config_path).expect("watch alacritty yml"); loop { let event = rx.recv().expect("watcher event");