A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
fix(theme): let the inactive-pane dimming follow the terminal background
RoversX84605b393c52
diff --git a/config/src/config.rs b/config/src/config.rsindex 375aca59..c735b03b 100644--- a/config/src/config.rs+++ b/config/src/config.rs@@ -671,8 +671,9 @@ pub struct Config {/// A subtle dimming effect can be achieved by setting:/// inactive_pane_saturation = 0.9/// inactive_pane_brightness = 0.8- #[dynamic(default = "default_inactive_pane_hsb")]- pub inactive_pane_hsb: HsbTransform,+ /// When unset, use brightness 0.95 on light terminal backgrounds and+ /// 0.8 on dark ones, with saturation 0.9. Explicit values are unchanged.+ pub inactive_pane_hsb: Option<HsbTransform>,#[dynamic(default = "default_one_point_oh")]pub text_background_opacity: f32,@@ -1040,6 +1041,18 @@ impl Default for Config {}impl Config {+ pub fn inactive_pane_hsb_for_background(&self, background: SrgbaTuple) -> HsbTransform {+ self.inactive_pane_hsb.unwrap_or_else(|| HsbTransform {+ brightness: if crate::color::is_light_terminal_background(background) {+ 0.95+ } else {+ 0.8+ },+ saturation: 0.9,+ hue: 1.0,+ })+ }+pub fn load() -> LoadedConfig {Self::load_with_overrides(&wezterm_dynamic::Value::default())}@@ -2177,14 +2190,6 @@ fn default_clean_exits() -> Vec<u32> {vec![]}-fn default_inactive_pane_hsb() -> HsbTransform {- HsbTransform {- brightness: 0.8,- saturation: 0.9,- hue: 1.0,- }-}-#[derive(FromDynamic, ToDynamic, Clone, Copy, Debug, Default)]pub enum DefaultCursorStyle {BlinkingBlock,@@ -2580,6 +2585,43 @@ mod tests {assert!(Config::default().note_remote_images_enabled);}+ #[test]+ fn inactive_pane_defaults_follow_the_terminal_background() {+ use super::SrgbaTuple;+ let config = Config::default();+ assert!(config.inactive_pane_hsb.is_none());+ let light = config.inactive_pane_hsb_for_background(SrgbaTuple(1.0, 0.98, 0.9, 1.0));+ let dark = config.inactive_pane_hsb_for_background(SrgbaTuple(0.1, 0.12, 0.15, 1.0));+ assert_eq!(light.brightness, 0.95);+ assert_eq!(dark.brightness, 0.8);+ assert_eq!(light.saturation, 0.9);+ assert_eq!(dark.saturation, 0.9);+ }++ #[test]+ fn explicit_inactive_pane_values_survive_dynamic_config_loading() {+ use super::{HsbTransform, SrgbaTuple};+ use wezterm_dynamic::{FromDynamic, Object, ToDynamic, Value};+ // Even an explicit choice equal to the old default must not be+ // mistaken for an unset field on light backgrounds.+ for brightness in [0.8, 0.4, 1.0] {+ let hsb = HsbTransform {+ hue: 1.0,+ saturation: 0.9,+ brightness,+ };+ let mut values = Object::default();+ values.insert(Value::String("inactive_pane_hsb".into()), hsb.to_dynamic());+ let config = Config::from_dynamic(&Value::Object(values), Default::default()).unwrap();+ for background in [+ SrgbaTuple(1.0, 1.0, 1.0, 1.0),+ SrgbaTuple(0.0, 0.0, 0.0, 1.0),+ ] {+ assert_eq!(config.inactive_pane_hsb_for_background(background), hsb);+ }+ }+ }+#[test]fn remote_mux_auto_claim_can_be_disabled_in_config() {use wezterm_dynamic::{FromDynamic, Object, Value};diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rsindex 0f99725f..e9a6eef5 100644--- a/wezterm-gui/src/settings_window.rs+++ b/wezterm-gui/src/settings_window.rs@@ -1126,12 +1126,15 @@ impl ImportFieldId {.unwrap_or_else(|| crate::i18n::tr("settings-import-preview-custom-colors")),Self::WindowBackgroundOpacity => format!("{:.2}", config.window_background_opacity),Self::MacosWindowBackgroundBlur => config.macos_window_background_blur.to_string(),- Self::InactivePaneHsb => format!(- "h {:.2}, s {:.2}, b {:.2}",- config.inactive_pane_hsb.hue,- config.inactive_pane_hsb.saturation,- config.inactive_pane_hsb.brightness- ),+ Self::InactivePaneHsb => {+ let palette: wezterm_term::color::ColorPalette =+ config.resolved_palette.clone().into();+ let hsb = config.inactive_pane_hsb_for_background(palette.background);+ format!(+ "h {:.2}, s {:.2}, b {:.2}",+ hsb.hue, hsb.saturation, hsb.brightness+ )+ }Self::FontSize => format!("{:.1}", config.font_size),Self::Font => config.font@@ -12291,7 +12294,7 @@ impl SettingsWindow {ImportFieldId::MacosWindowBackgroundBlur => {Some(config.macos_window_background_blur.to_dynamic())}- ImportFieldId::InactivePaneHsb => Some(config.inactive_pane_hsb.to_dynamic()),+ ImportFieldId::InactivePaneHsb => config.inactive_pane_hsb.map(|hsb| hsb.to_dynamic()),ImportFieldId::FontSize => Some(config.font_size.to_dynamic()),ImportFieldId::Font => Some(config.font.to_dynamic()),ImportFieldId::LineHeight => Some(config.line_height.to_dynamic()),diff --git a/wezterm-gui/src/termwindow/render/pane.rs b/wezterm-gui/src/termwindow/render/pane.rsindex a1f40311..9464a8fc 100644--- a/wezterm-gui/src/termwindow/render/pane.rs+++ b/wezterm-gui/src/termwindow/render/pane.rs@@ -1567,7 +1567,7 @@ impl crate::TermWindow {quad.set_hsv(if pos.is_active {None} else {- Some(config.inactive_pane_hsb)+ Some(config.inactive_pane_hsb_for_background(palette.background))});}@@ -1615,7 +1615,7 @@ impl crate::TermWindow {quad.set_hsv(if pos.is_active {None} else {- Some(config.inactive_pane_hsb)+ Some(config.inactive_pane_hsb_for_background(palette.background))});}}diff --git a/wezterm-gui/src/termwindow/render/screen_line.rs b/wezterm-gui/src/termwindow/render/screen_line.rsindex 9a7010ea..dd3f3a19 100644--- a/wezterm-gui/src/termwindow/render/screen_line.rs+++ b/wezterm-gui/src/termwindow/render/screen_line.rs@@ -45,7 +45,7 @@ impl crate::TermWindow {let hsv = if params.is_active {None} else {- Some(params.config.inactive_pane_hsb)+ Some(params.config.inactive_pane_hsb_for_background(params.palette.background))};let width_scale = if !params.line.is_single_width() {