aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <jwilm@users.noreply.github.com>2017-07-19 12:26:45 -0700
committerGitHub <noreply@github.com>2017-07-19 12:26:45 -0700
commitc8e4f366e740b98377bf6faf157af358b3bc70d2 (patch)
treefafb9d58797c82a7f161d93ef22ae02b6706193c
parent94849c4f2a19bd49337f5cf090f94ac6a940c414 (diff)
downloadalacritty-c8e4f366e740b98377bf6faf157af358b3bc70d2.tar.gz
alacritty-c8e4f366e740b98377bf6faf157af358b3bc70d2.zip
Canonicalize the config watching path (#672)
This should resolve an issue where config behind a symlink was not being properly reloaded when edited.
-rw-r--r--src/config.rs5
1 files 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");