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
feat(gui): add icons, app icon thumbnails and colour lookups for Settings
RoversX2ff52729f4b9
diff --git a/assets/icon/ThinkTerm_128.png b/assets/icon/ThinkTerm_128.pngnew file mode 100644index 00000000..30766778Binary files /dev/null and b/assets/icon/ThinkTerm_128.png differdiff --git a/assets/icon/ThinkTerm_simple_128.png b/assets/icon/ThinkTerm_simple_128.pngnew file mode 100644index 00000000..b876122eBinary files /dev/null and b/assets/icon/ThinkTerm_simple_128.png differdiff --git a/assets/icon/update.sh b/assets/icon/update.shindex c78f42aa..b85943e6 100755--- a/assets/icon/update.sh+++ b/assets/icon/update.sh@@ -28,6 +28,12 @@ if [ -f "$macos_icns" ]; thenfiif command -v sips >/dev/null 2>&1 ; thensips -z 512 512 -s format png "$macos_icns" --out ThinkTerm.png+ # The Appearance page's app icon choices, small so Settings never+ # decodes the full-size art to show them.+ sips -z 128 128 -s format png "$macos_icns" --out ThinkTerm_simple_128.png+ if [ -f "$classic_macos_icns" ]; then+ sips -z 128 128 -s format png "$classic_macos_icns" --out ThinkTerm_128.png+ fifielsepng2icns ../macos/ThinkTerm.app/Contents/Resources/ThinkTerm_simple.icns icon_*px.pngdiff --git a/wezterm-gui/src/bottom_quotes.rs b/wezterm-gui/src/bottom_quotes.rsindex 3f966860..ea508bec 100644--- a/wezterm-gui/src/bottom_quotes.rs+++ b/wezterm-gui/src/bottom_quotes.rs@@ -77,6 +77,23 @@ pub(crate) fn selected_quote(quotes.get(index).cloned()}+/// The quote a terminal would show now, for Settings to preview. Unlike+/// `selected_quote` it never writes: with no quotes file yet it picks from+/// the shipped list, and leaves making the file to the terminal that shows+/// one.+pub(crate) fn preview_quote(+ mode: NativeBottomQuoteMode,+ interval_minutes: u32,+) -> Option<BottomQuote> {+ let quotes = if quotes_path().exists() {+ load_quotes()+ } else {+ default_quotes()+ };+ let index = selected_index(mode, interval_minutes, quotes.len());+ quotes.get(index).cloned()+}+pub(crate) fn next_rotation_delay(interval_minutes: u32) -> Duration {let seconds = SystemTime::now().duration_since(UNIX_EPOCH)diff --git a/wezterm-gui/src/glyphcache.rs b/wezterm-gui/src/glyphcache.rsindex 171b460f..b5a2085c 100644--- a/wezterm-gui/src/glyphcache.rs+++ b/wezterm-gui/src/glyphcache.rs@@ -643,6 +643,9 @@ pub struct GlyphCache {pub app_icons: HashMap<u16, Sprite>,/// The CloseX logo on About, keyed by pixel height, like `app_icons`.pub closex_logos: HashMap<u16, Sprite>,+ /// The app icons Appearance offers to switch between, from their small+ /// copies; two icons at whatever size the page draws them.+ pub(crate) app_icon_choices: HashMap<(crate::native_settings::NativeAppIcon, u16), Sprite>,pub material_icons: HashMap<SizedMaterialIconKey, Sprite>,/// Pane tab glyphs, white masks keyed by shape and pixel size. The/// shapes are the tab icon cards', which are capped, so this stays@@ -734,6 +737,7 @@ impl GlyphCache {brand_icons: HashMap::new(),app_icons: HashMap::new(),closex_logos: HashMap::new(),+ app_icon_choices: HashMap::new(),material_icons: HashMap::new(),tab_glyphs: HashMap::new(),tab_glyph_failures: HashMap::new(),@@ -774,6 +778,7 @@ impl GlyphCache {brand_icons: HashMap::new(),app_icons: HashMap::new(),closex_logos: HashMap::new(),+ app_icon_choices: HashMap::new(),material_icons: HashMap::new(),tab_glyphs: HashMap::new(),tab_glyph_failures: HashMap::new(),@@ -1483,6 +1488,23 @@ impl GlyphCache {Ok(sprite)}+ pub(crate) fn cached_app_icon_choice(+ &mut self,+ icon: crate::native_settings::NativeAppIcon,+ size: usize,+ ) -> anyhow::Result<Sprite> {+ let size = size.max(1).min(u16::MAX as usize);+ let key = (icon, size as u16);+ if let Some(sprite) = self.app_icon_choices.get(&key) {+ return Ok(sprite.clone());+ }++ let image = crate::termwindow::ui::icons::rasterize_png_icon(icon.thumbnail(), size)?;+ let sprite = self.atlas.allocate(&image)?;+ self.app_icon_choices.insert(key, sprite.clone());+ Ok(sprite)+ }+pub fn cached_closex_logo(&mut self, height: usize) -> anyhow::Result<Sprite> {let height = height.max(1).min(u16::MAX as usize);let key = height as u16;diff --git a/wezterm-gui/src/native_settings.rs b/wezterm-gui/src/native_settings.rsindex 91917f1d..d46b6b96 100644--- a/wezterm-gui/src/native_settings.rs+++ b/wezterm-gui/src/native_settings.rs@@ -152,6 +152,17 @@ impl NativeAppIcon {Self::Classic => "ThinkTerm.icns",}}++ pub(crate) const ALL: [Self; 2] = [Self::Simple, Self::Classic];++ /// A 128px copy of the icon, for Settings to show as a choice: the+ /// full-size art is megabytes of PNG to decode for a 44pt picture.+ pub(crate) fn thumbnail(self) -> &'static [u8] {+ match self {+ Self::Simple => include_bytes!("../../assets/icon/ThinkTerm_simple_128.png"),+ Self::Classic => include_bytes!("../../assets/icon/ThinkTerm_128.png"),+ }+ }}#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]@@ -1155,6 +1166,29 @@ pub(crate) fn scheme_background(.map(|color| color.to_linear())}+/// The colours the terminal is painted in, resolved the way+/// `terminal_ground` resolves its background: a scheme picked in the command+/// palette counts, and `colors` in the configuration overlays whichever+/// scheme is in force.+pub(crate) fn terminal_palette(+ settings: &ThinkTermNativeSettings,+ config: &config::ConfigHandle,+) -> wezterm_term::color::ColorPalette {+ if let Some(name) = effective_color_scheme(settings, config) {+ let picked = config+ .color_schemes+ .get(&name)+ .or_else(|| config::COLOR_SCHEMES.get(&name));+ if let Some(scheme) = picked {+ return match &config.colors {+ Some(colors) => scheme.overlay_with(colors).into(),+ None => scheme.clone().into(),+ };+ }+ }+ config.resolved_palette.clone().into()+}+fn terminal_ground(config: &config::ConfigHandle) -> window::color::LinearRgba {// A scheme picked in the command palette is kept here, not in the// configuration: it reaches a terminal window through that window's owndiff --git a/wezterm-gui/src/termwindow/ui/icons.rs b/wezterm-gui/src/termwindow/ui/icons.rsindex 64f07687..8e1989f0 100644--- a/wezterm-gui/src/termwindow/ui/icons.rs+++ b/wezterm-gui/src/termwindow/ui/icons.rs@@ -99,6 +99,26 @@ pub enum SvgIcon {Terminal,Trash2,Unlink2,+ ALargeSmall,+ AppWindow,+ Bold,+ CircleStop,+ Columns2,+ Contrast,+ FileCog,+ MessageSquareQuote,+ Mouse,+ MoveVertical,+ Power,+ RotateCw,+ Shuffle,+ Timer,+ Type,+ Laptop,+ QrCode,+ Smartphone,+ Upload,+ Wifi,X,// Coding-agent brand marks whose logo is monochrome by design, from// lobe-icons rather than lucide (see third_party/lobe-icons/README).@@ -320,6 +340,38 @@ impl SvgIcon {}Self::Terminal => include_bytes!("../../../../third_party/lucide/icons/terminal.svg"),Self::Trash2 => include_bytes!("../../../../third_party/lucide/icons/trash-2.svg"),+ Self::ALargeSmall => {+ include_bytes!("../../../../third_party/lucide/icons/a-large-small.svg")+ }+ Self::AppWindow => {+ include_bytes!("../../../../third_party/lucide/icons/app-window.svg")+ }+ Self::Bold => include_bytes!("../../../../third_party/lucide/icons/bold.svg"),+ Self::CircleStop => {+ include_bytes!("../../../../third_party/lucide/icons/circle-stop.svg")+ }+ Self::Columns2 => include_bytes!("../../../../third_party/lucide/icons/columns-2.svg"),+ Self::Contrast => include_bytes!("../../../../third_party/lucide/icons/contrast.svg"),+ Self::FileCog => include_bytes!("../../../../third_party/lucide/icons/file-cog.svg"),+ Self::MessageSquareQuote => {+ include_bytes!("../../../../third_party/lucide/icons/message-square-quote.svg")+ }+ Self::Mouse => include_bytes!("../../../../third_party/lucide/icons/mouse.svg"),+ Self::MoveVertical => {+ include_bytes!("../../../../third_party/lucide/icons/move-vertical.svg")+ }+ Self::Power => include_bytes!("../../../../third_party/lucide/icons/power.svg"),+ Self::RotateCw => include_bytes!("../../../../third_party/lucide/icons/rotate-cw.svg"),+ Self::Shuffle => include_bytes!("../../../../third_party/lucide/icons/shuffle.svg"),+ Self::Timer => include_bytes!("../../../../third_party/lucide/icons/timer.svg"),+ Self::Type => include_bytes!("../../../../third_party/lucide/icons/type.svg"),+ Self::Laptop => include_bytes!("../../../../third_party/lucide/icons/laptop.svg"),+ Self::QrCode => include_bytes!("../../../../third_party/lucide/icons/qr-code.svg"),+ Self::Smartphone => {+ include_bytes!("../../../../third_party/lucide/icons/smartphone.svg")+ }+ Self::Upload => include_bytes!("../../../../third_party/lucide/icons/upload.svg"),+ Self::Wifi => include_bytes!("../../../../third_party/lucide/icons/wifi.svg"),Self::X => include_bytes!("../../../../third_party/lucide/icons/x.svg"),Self::AgentCodex => include_bytes!("../../../../third_party/lobe-icons/openai.svg"),Self::AgentCursor => {@@ -624,9 +676,15 @@ pub fn distro_to_icon(id: &str) -> Option<BrandIcon> {/// atlas stores premultiplied -- the multiply below is what stops the icon's/// soft edges from ringing bright against a dark card.pub fn rasterize_app_icon(size: usize) -> Result<Image> {+ rasterize_png_icon(crate::termwindow::ICON_DATA, size)+}++/// `png` scaled to `size` square and premultiplied for the atlas, the way+/// `rasterize_app_icon` does the About page's icon.+pub fn rasterize_png_icon(png: &[u8], size: usize) -> Result<Image> {let size = size.max(1);- let decoded = image::load_from_memory(crate::termwindow::ICON_DATA)- .context("decoding the application icon")?+ let decoded = image::load_from_memory(png)+ .context("decoding an application icon")?.resize_exact(size as u32,size as u32,