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): share background-aware inactive pane defaults
RoversXc02f5fc22cf6
diff --git a/color-types/src/lib.rs b/color-types/src/lib.rsindex 7a207d26..ec7a5507 100644--- a/color-types/src/lib.rs+++ b/color-types/src/lib.rs@@ -30,6 +30,26 @@ pub struct HsbTransform {pub brightness: f32,}+/// Classify the terminal palette itself, independently of the OS appearance.+pub fn is_light_terminal_background(background: SrgbaTuple) -> bool {+ 0.2126 * background.0 + 0.7152 * background.1 + 0.0722 * background.2 > 0.5+}++impl HsbTransform {+ /// The shared desktop and browser default for an unfocused terminal pane.+ pub fn for_inactive_pane(background: SrgbaTuple) -> Self {+ Self {+ hue: 1.0,+ saturation: 0.9,+ brightness: if is_light_terminal_background(background) {+ 0.95+ } else {+ 0.8+ },+ }+ }+}+fn default_one_point_oh() -> f32 {1.0}diff --git a/config/src/color.rs b/config/src/color.rsindex 76738b25..6246d5eb 100644--- a/config/src/color.rs+++ b/config/src/color.rs@@ -8,12 +8,7 @@ pub use termwiz::color::{AnsiColor, ColorAttribute, RgbColor, SrgbaTuple};use wezterm_dynamic::{FromDynamic, ToDynamic};use wezterm_term::color::ColorPalette;-pub use wezterm_color_types::HsbTransform;--/// Classify the terminal palette itself, independently of the OS appearance.-pub fn is_light_terminal_background(background: SrgbaTuple) -> bool {- 0.2126 * background.0 + 0.7152 * background.1 + 0.0722 * background.2 > 0.5-}+pub use wezterm_color_types::{is_light_terminal_background, HsbTransform};#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, FromDynamic, ToDynamic)]#[dynamic(try_from = "String", into = "String")]diff --git a/config/src/config.rs b/config/src/config.rsindex c735b03b..c5844bf1 100644--- a/config/src/config.rs+++ b/config/src/config.rs@@ -1042,15 +1042,8 @@ 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,- })+ self.inactive_pane_hsb+ .unwrap_or_else(|| HsbTransform::for_inactive_pane(background))}pub fn load() -> LoadedConfig {diff --git a/thinkterm-web/src/app.rs b/thinkterm-web/src/app.rsindex 98243df0..87255b1f 100644--- a/thinkterm-web/src/app.rs+++ b/thinkterm-web/src/app.rs@@ -69,13 +69,6 @@ const RECONNECT_DOUBT_AFTER: u32 = 6;const RECONNECT_STABLE_MS: f64 = 5_000.0;/// How long the close button waits for its second press.const CLOSE_CONFIRM_MS: f64 = 3_000.0;-/// The desktop's `inactive_pane_hsb` default: panes without the focus are-/// a little darker and a little greyer.-const INACTIVE_PANE_HSB: wezterm_color_types::HsbTransform = wezterm_color_types::HsbTransform {- hue: 1.0,- saturation: 0.9,- brightness: 0.8,-};pub struct Setup {pub link: WsLink,@@ -4784,7 +4777,11 @@ impl App {let palette = cell.palette.clone();let selection = cell.selection;let is_focused = place.pane_id == inner.focused_pane;- let hsv = if is_focused { None } else { Some(INACTIVE_PANE_HSB) };+ let hsv = if is_focused {+ None+ } else {+ Some(wezterm_color_types::HsbTransform::for_inactive_pane(palette.background))+ };// A pane with its own font draws from its own cache, into its// own batch.let own_font = Self::pane_font_shown(inner, place);