diff --git a/Cargo.toml b/Cargo.toml index 1b54aff80..0ceb38c87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,7 @@ winapi = { version = "0.3", features = [ "synchapi", "winsock2", ]} +winrt-notification = "0.2" [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] fontconfig = { path = "deps/fontconfig" } diff --git a/src/config/mod.rs b/src/config/mod.rs index 4f743e084..b108f827c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -151,13 +151,14 @@ impl ConfigInner { } } Err(err) => { + let err = err.to_string(); log::error!("While reloading configuration: {}", err); #[cfg(not(windows))] { notify_rust::Notification::new() .summary("Wezterm Configuration") - .body(&format!("{}", err)) + .body(&err) // Stay on the screen until dismissed .hint(notify_rust::NotificationHint::Resident(true)) // timeout isn't respected on macos @@ -166,7 +167,19 @@ impl ConfigInner { .ok(); } - self.error.replace(err.to_string()); + #[cfg(windows)] + { + use winrt_notification::Toast; + + Toast::new(Toast::POWERSHELL_APP_ID) + .title("Wezterm Configuration") + .text1(&err) + .duration(winrt_notification::Duration::Long) + .show() + .ok(); + } + + self.error.replace(err); } } }