1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

add basic notifications if the config is broken during reload

This commit is contained in:
Wez Furlong 2019-12-04 18:26:47 -08:00
parent fc53b3969a
commit c547b03b8b
2 changed files with 16 additions and 0 deletions

View File

@ -32,6 +32,7 @@ libc = "0.2"
log = "0.4"
open = "1.2"
native-tls = "0.2"
# file change notification
notify = "4.0"
palette = "0.4"
portable-pty = { path = "pty", features = ["serde_support", "ssh"]}
@ -57,6 +58,10 @@ zstd = "0.4"
[target.'cfg(unix)'.dependencies]
daemonize = "0.4"
[target.'cfg(not(windows))'.dependencies]
# show a notification
notify-rust = "3"
# on linux, font-loader pulls in servo-font* crates which conflict with
# our newer font related deps, so we avoid it on linux
[target.'cfg(any(windows, target_os = "macos"))'.dependencies]

View File

@ -146,6 +146,17 @@ impl ConfigInner {
}
Err(err) => {
log::error!("While reloading configuration: {}", err);
#[cfg(not(windows))]
{
notify_rust::Notification::new()
.summary("Wezterm Configuration")
.body(&format!("{}", err))
// timeout isn't respected on macos
.timeout(0)
.show().ok();
}
self.error.replace(err.to_string());
}
}