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
Still, compatibility test, Reserve space for integrated title buttons
RoversXfaf6697a1e75
diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rsindex 4d485050..9e5c0cef 100644--- a/wezterm-gui/src/termwindow/mouseevent.rs+++ b/wezterm-gui/src/termwindow/mouseevent.rs@@ -125,10 +125,11 @@ impl super::TermWindow {};sidebar_actions_width- + if self- .config- .window_decorations- .contains(WindowDecorations::INTEGRATED_BUTTONS)+ + if self.right_sidebar_width() == 0+ && self+ .config+ .window_decorations+ .contains(WindowDecorations::INTEGRATED_BUTTONS)&& self.config.integrated_title_button_style!= IntegratedTitleButtonStyle::MacOsNative{diff --git a/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs b/wezterm-gui/src/termwindow/render/fancy_tab_bar.rsindex 92cb0229..18f041f1 100644--- a/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs+++ b/wezterm-gui/src/termwindow/render/fancy_tab_bar.rs@@ -243,10 +243,18 @@ impl crate::TermWindow {let mut action_right = row_right.saturating_sub(WINDOW_TAB_INSET + 2);if self.fancy_tab_bar_shows_window_buttons() {- action_right = self.paint_window_tab_window_buttons(+ let window_button_right = if self.right_sidebar_width() > 0 {+ self.dimensions+ .pixel_width+ .saturating_sub(border.right.get() as usize)+ .saturating_sub(WINDOW_TAB_INSET + 2)+ } else {+ action_right+ };+ let window_button_left = self.paint_window_tab_window_buttons(layers,&mut ui_items,- action_right,+ window_button_right,content_row_y,content_row_height,button_size,@@ -254,6 +262,9 @@ impl crate::TermWindow {foreground,muted_fg,)?;+ if self.right_sidebar_width() == 0 {+ action_right = window_button_left;+ }}if self.right_sidebar_width() > 0 {@@ -535,8 +546,8 @@ impl crate::TermWindow {.intersects(WindowState::MAXIMIZED | WindowState::FULL_SCREEN);let icon = match button {IntegratedTitleButton::Hide => SvgIcon::Minus,- IntegratedTitleButton::Maximize if maximized => SvgIcon::Minimize2,- IntegratedTitleButton::Maximize => SvgIcon::Maximize2,+ IntegratedTitleButton::Maximize if maximized => SvgIcon::Copy,+ IntegratedTitleButton::Maximize => SvgIcon::Square,IntegratedTitleButton::Close => SvgIcon::X,};let icon_size = if pressed {diff --git a/wezterm-gui/src/termwindow/ui/icons.rs b/wezterm-gui/src/termwindow/ui/icons.rsindex e9db0f88..83773273 100644--- a/wezterm-gui/src/termwindow/ui/icons.rs+++ b/wezterm-gui/src/termwindow/ui/icons.rs@@ -14,6 +14,7 @@ pub enum SvgIcon {Cloud,CodeXml,ClipboardPaste,+ Copy,Ellipsis,Expand,ExternalLink,@@ -58,6 +59,7 @@ pub enum SvgIcon {CircleCheck,CirclePlus,SquarePlus,+ Square,SquareStack,SquareTerminal,SplitHorizontal,@@ -88,6 +90,7 @@ impl SvgIcon {Self::ClipboardPaste => {include_bytes!("../../../../third_party/lucide/icons/clipboard-paste.svg")}+ Self::Copy => include_bytes!("../../../../third_party/lucide/icons/copy.svg"),Self::Ellipsis => include_bytes!("../../../../third_party/lucide/icons/ellipsis.svg"),Self::Expand => include_bytes!("../../../../third_party/lucide/icons/expand.svg"),Self::ExternalLink => {@@ -177,6 +180,7 @@ impl SvgIcon {Self::CirclePlus => {include_bytes!("../../../../third_party/lucide/icons/circle-plus.svg")}+ Self::Square => include_bytes!("../../../../third_party/lucide/icons/square.svg"),Self::SquarePlus => {include_bytes!("../../../../third_party/lucide/icons/square-plus.svg")}@@ -383,6 +387,7 @@ mod tests {SvgIcon::ChevronRight,SvgIcon::Cloud,SvgIcon::CodeXml,+ SvgIcon::Copy,SvgIcon::Expand,SvgIcon::Folder,SvgIcon::FolderOpen,@@ -417,6 +422,7 @@ mod tests {SvgIcon::CircleAlert,SvgIcon::CircleCheck,SvgIcon::CirclePlus,+ SvgIcon::Square,SvgIcon::SquareTerminal,SvgIcon::SplitHorizontal,SvgIcon::SplitVertical,diff --git a/wezterm-gui/src/termwindow/ui/platform_chrome.rs b/wezterm-gui/src/termwindow/ui/platform_chrome.rsindex d829e750..e30403ac 100644--- a/wezterm-gui/src/termwindow/ui/platform_chrome.rs+++ b/wezterm-gui/src/termwindow/ui/platform_chrome.rs@@ -141,6 +141,8 @@ pub fn workspace_sidebar_toolbar_uses_fullscreen_style(window_state: WindowStatepub fn workspace_sidebar_toolbar_button_size(window_state: WindowState) -> usize {if workspace_sidebar_toolbar_uses_fullscreen_style(window_state) {WINDOW_TAB_FULLSCREEN_SIDEBAR_BUTTON_SIZE+ } else if !cfg!(target_os = "macos") {+ WINDOW_TAB_LEADING_ACTION_BUTTON_SIZE + 8} else {WINDOW_TAB_LEADING_ACTION_BUTTON_SIZE}@@ -149,6 +151,8 @@ pub fn workspace_sidebar_toolbar_button_size(window_state: WindowState) -> usizepub fn workspace_sidebar_toolbar_icon_size(window_state: WindowState) -> usize {if workspace_sidebar_toolbar_uses_fullscreen_style(window_state) {WINDOW_TAB_FULLSCREEN_SIDEBAR_ICON_SIZE+ } else if !cfg!(target_os = "macos") {+ WINDOW_TAB_LEADING_ACTION_ICON_SIZE + 6} else {WINDOW_TAB_LEADING_ACTION_ICON_SIZE}diff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rsindex ad9d9d7b..9bb18686 100644--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs@@ -3,6 +3,7 @@ use crate::termwindow::ui::icons::SvgIcon;use crate::termwindow::ui::tokens::{CAPSULE_BORDER_WIDTH, ICON_BUTTON_BORDER_WIDTH, SIDEBAR_ICON_GAP, SIDEBAR_INSET,SIDEBAR_RESIZE_HANDLE_WIDTH, SIDEBAR_ROW_RADIUS, WINDOW_TAB_ADD_BUTTON_RADIUS,+ WINDOW_TAB_LEADING_ACTION_BUTTON_SIZE, WINDOW_TAB_LEADING_ACTION_GAP,};use crate::termwindow::{RightSidebarMode, RightSidebarSnippetField, RightSidebarSnippetView, TermWindowNotif, UIItem,@@ -18,7 +19,7 @@ use std::time::{Duration, Instant};use termwiz::input::{KeyCode as TermKeyCode, Modifiers as TermModifiers};use wezterm_font::LoadedFont;use window::color::LinearRgba;-use window::{Clipboard, WindowOps};+use window::{Clipboard, IntegratedTitleButtonStyle, WindowDecorations, WindowOps};const RIGHT_SIDEBAR_SECTION_GAP: usize = 12;const RIGHT_SIDEBAR_WIDTH_CELLS: usize = 34;@@ -112,6 +113,22 @@ impl crate::TermWindow {RIGHT_SIDEBAR_MAX_WIDTH.min((self.dimensions.pixel_width / 2).max(RIGHT_SIDEBAR_MIN_WIDTH))}+ fn right_sidebar_window_button_reserved_width(&self) -> usize {+ if cfg!(target_os = "macos")+ || !self+ .config+ .window_decorations+ .contains(WindowDecorations::INTEGRATED_BUTTONS)+ || self.config.integrated_title_button_style == IntegratedTitleButtonStyle::MacOsNative+ {+ return 0;+ }++ self.config.integrated_title_buttons.len()+ * (WINDOW_TAB_LEADING_ACTION_BUTTON_SIZE + WINDOW_TAB_LEADING_ACTION_GAP / 2)+ + WINDOW_TAB_LEADING_ACTION_GAP+ }+pub fn set_right_sidebar_width(&mut self, width: usize) {self.right_sidebar_width =width.clamp(RIGHT_SIDEBAR_MIN_WIDTH, self.right_sidebar_max_width());@@ -692,16 +709,18 @@ impl crate::TermWindow {.min(top_bar_height).min(content_width).max(1);+ let window_button_reserve = self.right_sidebar_window_button_reserved_width();+ let close_button_right_limit = rect+ .x+ .saturating_add(rect.width)+ .saturating_sub(SIDEBAR_INSET)+ .saturating_sub(close_button_size)+ .saturating_sub(window_button_reserve);let close_button_x = content_x.saturating_add(content_width).saturating_sub(close_button_size).saturating_add(RIGHT_SIDEBAR_CLOSE_BUTTON_X_ADJUST)- .min(- rect.x- .saturating_add(rect.width)- .saturating_sub(SIDEBAR_INSET)- .saturating_sub(close_button_size),- );+ .min(close_button_right_limit);let close_button_y = (top_bar_y + (top_bar_height.saturating_sub(close_button_size)) / 2).saturating_sub(RIGHT_SIDEBAR_CLOSE_BUTTON_Y_ADJUST);let close_hovered = self.is_pointer_over_ui_rect(