mirror of
https://github.com/wez/wezterm.git
synced 2024-11-12 21:30:45 +03:00
add basic notifications if the config is broken during reload
This commit is contained in:
parent
fc53b3969a
commit
c547b03b8b
@ -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]
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user