diff --git a/docs/changelog.md b/docs/changelog.md index 523c8f60c..407ed8edd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -59,6 +59,8 @@ As features stabilize some brief notes about them will accumulate here. * Cells with the invisible/hidden attribute are now invisible * Panic when trying to activate the search overlay when the launcher menu is active [#2529](https://github.com/wez/wezterm/issues/2529) +* Overlays did not see config overrides set via `window:set_config_overrides` + [#2544](https://github.com/wez/wezterm/issues/2544) #### Changed * Removed Last Resort fallback font diff --git a/mux/src/connui.rs b/mux/src/connui.rs index 7a0a651ea..b1b721efb 100644 --- a/mux/src/connui.rs +++ b/mux/src/connui.rs @@ -273,6 +273,7 @@ impl ConnectionUI { } Ok(()) }, + None, )) .detach(); Self { tx } diff --git a/mux/src/termwiztermtab.rs b/mux/src/termwiztermtab.rs index 47b91d70c..32ac5659d 100644 --- a/mux/src/termwiztermtab.rs +++ b/mux/src/termwiztermtab.rs @@ -97,12 +97,13 @@ impl TermWizTerminalPane { size: TerminalSize, input_tx: Sender, render_rx: FileDescriptor, + term_config: Option>, ) -> Self { let pane_id = alloc_pane_id(); let terminal = RefCell::new(wezterm_term::Terminal::new( size, - std::sync::Arc::new(config::TermConfig::new()), + term_config.unwrap_or_else(|| Arc::new(config::TermConfig::new())), "WezTerm", config::wezterm_version(), Box::new(Vec::new()), // FIXME: connect to something? @@ -431,7 +432,10 @@ impl termwiz::terminal::Terminal for TermWizTerminal { } } -pub fn allocate(size: TerminalSize) -> (TermWizTerminal, Rc) { +pub fn allocate( + size: TerminalSize, + config: Arc, +) -> (TermWizTerminal, Rc) { let render_pipe = Pipe::new().expect("Pipe creation not to fail"); let (input_tx, input_rx) = channel(); @@ -454,7 +458,7 @@ pub fn allocate(size: TerminalSize) -> (TermWizTerminal, Rc) { }; let domain_id = 0; - let pane = TermWizTerminalPane::new(domain_id, size, input_tx, render_pipe.read); + let pane = TermWizTerminalPane::new(domain_id, size, input_tx, render_pipe.read, Some(config)); // Add the tab to the mux so that the output is processed let pane: Rc = Rc::new(pane); @@ -478,6 +482,7 @@ pub async fn run< size: TerminalSize, window_id: Option, f: F, + term_config: Option>, ) -> anyhow::Result { let render_pipe = Pipe::new().expect("Pipe creation not to fail"); let render_rx = render_pipe.read; @@ -506,6 +511,7 @@ pub async fn run< render_rx: FileDescriptor, size: TerminalSize, window_id: Option, + term_config: Option>, ) -> anyhow::Result<(PaneId, WindowId)> { let mux = Mux::get().unwrap(); @@ -522,7 +528,8 @@ pub async fn run< } }; - let pane = TermWizTerminalPane::new(domain.domain_id(), size, input_tx, render_rx); + let pane = + TermWizTerminalPane::new(domain.domain_id(), size, input_tx, render_rx, term_config); let pane: Rc = Rc::new(pane); let tab = Rc::new(Tab::new(&size)); @@ -541,7 +548,7 @@ pub async fn run< } let (pane_id, window_id) = promise::spawn::spawn_into_main_thread(async move { - register_tab(input_tx, render_rx, size, window_id).await + register_tab(input_tx, render_rx, size, window_id, term_config).await }) .await?; diff --git a/wezterm-gui/src/overlay/mod.rs b/wezterm-gui/src/overlay/mod.rs index 303f5a62f..dbffda54f 100644 --- a/wezterm-gui/src/overlay/mod.rs +++ b/wezterm-gui/src/overlay/mod.rs @@ -4,7 +4,8 @@ use mux::tab::{Tab, TabId}; use mux::termwiztermtab::{allocate, TermWizTerminal}; use std::pin::Pin; use std::rc::Rc; -use wezterm_term::TerminalSize; +use std::sync::Arc; +use wezterm_term::{TerminalConfiguration, TerminalSize}; pub mod confirm_close_pane; pub mod copy; @@ -34,7 +35,9 @@ where { let tab_id = tab.tab_id(); let tab_size = tab.get_size(); - let (tw_term, tw_tab) = allocate(tab_size); + let term_config: Arc = + Arc::new(config::TermConfig::with_config(term_window.config.clone())); + let (tw_term, tw_tab) = allocate(tab_size, term_config); let window = term_window.window.clone().unwrap(); @@ -70,7 +73,9 @@ where pixel_height: term_window.render_metrics.cell_size.height as usize * dims.viewport_rows, dpi: dims.dpi, }; - let (tw_term, tw_tab) = allocate(size); + let term_config: Arc = + Arc::new(config::TermConfig::with_config(term_window.config.clone())); + let (tw_term, tw_tab) = allocate(size, term_config); let window = term_window.window.clone().unwrap();