diff --git a/mux/src/termwiztermtab.rs b/mux/src/termwiztermtab.rs index 60d22c966..ec9146452 100644 --- a/mux/src/termwiztermtab.rs +++ b/mux/src/termwiztermtab.rs @@ -29,7 +29,9 @@ use termwiz::terminal::{ScreenSize, TerminalWaker}; use termwiz::Context; use url::Url; use wezterm_term::color::ColorPalette; -use wezterm_term::{KeyCode, KeyModifiers, MouseEvent, StableRowIndex, TerminalSize}; +use wezterm_term::{ + KeyCode, KeyModifiers, MouseEvent, StableRowIndex, TerminalConfiguration, TerminalSize, +}; struct TermWizTerminalDomain { domain_id: DomainId, @@ -217,6 +219,14 @@ impl Pane for TermWizTerminalPane { Ok(()) } + fn set_config(&self, config: Arc) { + self.terminal.borrow_mut().set_config(config); + } + + fn get_config(&self) -> Option> { + Some(self.terminal.borrow().get_config()) + } + fn perform_actions(&self, actions: Vec) { self.terminal.borrow_mut().perform_actions(actions) } diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs index 788d281fb..1812a1e8c 100644 --- a/wezterm-gui/src/termwindow/mod.rs +++ b/wezterm-gui/src/termwindow/mod.rs @@ -792,6 +792,17 @@ impl TermWindow { } WindowEvent::AppearanceChanged(appearance) => { log::debug!("Appearance is now {:?}", appearance); + // This is a bit fugly; we get per-window notifications + // for appearance changes which successfully updates the + // per-window config, but we need to explicitly tell the + // global config to reload, otherwise things that acces + // the config via config::configuration() will see the + // prior version of the config. + // What's fugly about this is that we'll reload the + // global config here once per window, which could + // be nasty for folks with a lot of windows. + // + config::reload(); self.config_was_reloaded(); Ok(true) } @@ -1454,7 +1465,17 @@ impl TermWindow { pane.pane.set_config(Arc::clone(&term_config)); } } - }; + for state in self.pane_state.borrow().values() { + if let Some(overlay) = &state.overlay { + overlay.pane.set_config(Arc::clone(&term_config)); + } + } + for state in self.tab_state.borrow().values() { + if let Some(overlay) = &state.overlay { + overlay.pane.set_config(Arc::clone(&term_config)); + } + } + } if let Some(window) = self.window.as_ref().map(|w| w.clone()) { self.load_os_parameters();