1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

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

View file

@ -1410,9 +1410,10 @@ impl Monitor {
_thread: ::util::thread::spawn_named("config watcher", move || { _thread: ::util::thread::spawn_named("config watcher", move || {
let (tx, rx) = mpsc::channel(); let (tx, rx) = mpsc::channel();
let mut watcher = FileWatcher::new(tx).unwrap(); 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 { loop {
let event = rx.recv().expect("watcher event"); let event = rx.recv().expect("watcher event");