Canonicalize the config watching path (#672)

This should resolve an issue where config behind a symlink was not being
properly reloaded when edited.
This commit is contained in:
Joe Wilm 2017-07-19 12:26:45 -07:00 committed by GitHub
parent 94849c4f2a
commit c8e4f366e7
1 changed files with 3 additions and 2 deletions

View File

@ -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");