diff --git a/wezterm/src/connui.rs b/wezterm/src/connui.rs index fd630c34e..e262ebe98 100644 --- a/wezterm/src/connui.rs +++ b/wezterm/src/connui.rs @@ -427,13 +427,9 @@ fn get_error_window() -> ConnectionUI { /// If there is no GUI front end, generates a toast notification instead. pub fn show_configuration_error_message(err: &str) { log::error!("While (re)loading configuration: {}", err); - if crate::frontend::has_gui_front_end() { - let ui = get_error_window(); + let ui = get_error_window(); - let mut wrapped = textwrap::fill(&err, 78); - wrapped.push_str("\n"); - ui.output_str(&wrapped); - } else { - crate::toast_notification("Wezterm Configuration", &err); - } + let mut wrapped = textwrap::fill(&err, 78); + wrapped.push_str("\n"); + ui.output_str(&wrapped); } diff --git a/wezterm/src/frontend/mod.rs b/wezterm/src/frontend/mod.rs index 9d8efb912..674f750fb 100644 --- a/wezterm/src/frontend/mod.rs +++ b/wezterm/src/frontend/mod.rs @@ -2,7 +2,6 @@ use anyhow::Error; use downcast_rs::{impl_downcast, Downcast}; use std::cell::RefCell; use std::rc::Rc; -use std::sync::atomic::{AtomicBool, Ordering}; pub mod gui; @@ -12,15 +11,6 @@ thread_local! { static FRONT_END: RefCell>> = RefCell::new(None); } -static HAS_GUI_FRONT_END: AtomicBool = AtomicBool::new(false); - -/// Returns true if a GUI frontend has been initialized, which implies that -/// it makes sense (and is safe) to use the window crate and associated -/// functionality -pub fn has_gui_front_end() -> bool { - HAS_GUI_FRONT_END.load(Ordering::Acquire) -} - pub fn front_end() -> Option> { let mut res = None; FRONT_END.with(|f| { @@ -45,7 +35,6 @@ pub fn try_new(sel: FrontEndSelection) -> Result, Error> { let front_end = front_end?; FRONT_END.with(|f| *f.borrow_mut() = Some(Rc::clone(&front_end))); - HAS_GUI_FRONT_END.store(true, Ordering::Release); Ok(front_end) } diff --git a/wezterm/src/update.rs b/wezterm/src/update.rs index 3c458e68b..81b0e33bd 100644 --- a/wezterm/src/update.rs +++ b/wezterm/src/update.rs @@ -296,7 +296,7 @@ fn update_checker() { pub fn start_update_checker() { static CHECKER_STARTED: AtomicBool = AtomicBool::new(false); - if crate::frontend::has_gui_front_end() && configuration().check_for_updates { + if configuration().check_for_updates { if CHECKER_STARTED.compare_and_swap(false, true, Ordering::Relaxed) == false { std::thread::Builder::new() .name("update_checker".into())