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): show an empty state in the Status panel
RoversX0585a2f8af8e
diff --git a/thinkterm-i18n/i18n/de-DE.ftl b/thinkterm-i18n/i18n/de-DE.ftlindex c58f5d91..6bcc93e6 100644--- a/thinkterm-i18n/i18n/de-DE.ftl+++ b/thinkterm-i18n/i18n/de-DE.ftl@@ -931,6 +931,8 @@ right-agents-state-unknown = Unbekanntright-agents-state-error = Fehlerright-agents-state-done = Fertigright-agents-none = Keine Agents erkannt+right-agents-empty-title = Nichts zu melden+right-agents-empty-detail = Agents und Aufgaben erscheinen hier.right-agents-group-other = Sonstigeright-agents-all-hidden = Alle Agents sind durch die Ansichtsoptionen ausgeblendethover-card-agents = { $count ->diff --git a/thinkterm-i18n/i18n/en-US.ftl b/thinkterm-i18n/i18n/en-US.ftlindex 1d490fc7..ce79b2e8 100644--- a/thinkterm-i18n/i18n/en-US.ftl+++ b/thinkterm-i18n/i18n/en-US.ftl@@ -931,6 +931,8 @@ right-agents-state-unknown = Unknownright-agents-state-error = Errorright-agents-state-done = Doneright-agents-none = No agents detected+right-agents-empty-title = Nothing to report+right-agents-empty-detail = Agents and tasks show up here.right-agents-group-other = Otherright-agents-all-hidden = Every agent is hidden by the view optionshover-card-agents = { $count ->diff --git a/thinkterm-i18n/i18n/fr-FR.ftl b/thinkterm-i18n/i18n/fr-FR.ftlindex 96c518af..efae6f47 100644--- a/thinkterm-i18n/i18n/fr-FR.ftl+++ b/thinkterm-i18n/i18n/fr-FR.ftl@@ -931,6 +931,8 @@ right-agents-state-unknown = Inconnuright-agents-state-error = Erreurright-agents-state-done = Terminéright-agents-none = Aucun agent détecté+right-agents-empty-title = Rien à signaler+right-agents-empty-detail = Les agents et les tâches apparaissent ici.right-agents-group-other = Autresright-agents-all-hidden = Tous les agents sont masqués par les options d’affichagehover-card-agents = { $count ->diff --git a/thinkterm-i18n/i18n/ja-JP.ftl b/thinkterm-i18n/i18n/ja-JP.ftlindex 82b6096d..2285aeea 100644--- a/thinkterm-i18n/i18n/ja-JP.ftl+++ b/thinkterm-i18n/i18n/ja-JP.ftl@@ -907,6 +907,8 @@ right-agents-state-unknown = 不明right-agents-state-error = エラーright-agents-state-done = 完了right-agents-none = エージェントは検出されていません+right-agents-empty-title = 表示する状態はありません+right-agents-empty-detail = エージェントやタスクがここに表示されます。right-agents-group-other = その他right-agents-all-hidden = 表示オプションですべてのエージェントが非表示ですhover-card-agents = { $count } 個のエージェントdiff --git a/thinkterm-i18n/i18n/ru-RU.ftl b/thinkterm-i18n/i18n/ru-RU.ftlindex f110b993..14884e8c 100644--- a/thinkterm-i18n/i18n/ru-RU.ftl+++ b/thinkterm-i18n/i18n/ru-RU.ftl@@ -905,6 +905,8 @@ right-agents-state-unknown = Неизвестноright-agents-state-error = Ошибкаright-agents-state-done = Готовоright-agents-none = Агенты не обнаружены+right-agents-empty-title = Пока нечего показать+right-agents-empty-detail = Здесь появятся агенты и задачи.right-agents-group-other = Другиеright-agents-all-hidden = Все агенты скрыты параметрами видаhover-card-agents = { $count ->diff --git a/thinkterm-i18n/i18n/zh-CN.ftl b/thinkterm-i18n/i18n/zh-CN.ftlindex d2311adf..f4cb2c73 100644--- a/thinkterm-i18n/i18n/zh-CN.ftl+++ b/thinkterm-i18n/i18n/zh-CN.ftl@@ -907,6 +907,8 @@ right-agents-state-unknown = 未知right-agents-state-error = 出错right-agents-state-done = 已完成right-agents-none = 未检测到 Agent+right-agents-empty-title = 暂无状态+right-agents-empty-detail = Agent 和任务会显示在这里。right-agents-group-other = 其他right-agents-all-hidden = 显示选项隐藏了所有 Agenthover-card-agents = { $count } 个 Agentdiff --git a/wezterm-gui/src/termwindow/ui/agent_panel.rs b/wezterm-gui/src/termwindow/ui/agent_panel.rsindex 661380f1..14da1937 100644--- a/wezterm-gui/src/termwindow/ui/agent_panel.rs+++ b/wezterm-gui/src/termwindow/ui/agent_panel.rs@@ -11,6 +11,7 @@ use crate::quad::TripleLayerQuadAllocator;use crate::termwindow::ui::icons::SvgIcon;use crate::termwindow::ui::right_sidebar::{right_sidebar_file_row_metrics, sidebar_row_element_visible, FILE_SCROLL_FADE_HEIGHT,+ REMOTE_EMPTY_DETAIL_GAP, REMOTE_EMPTY_ICON_GAP, REMOTE_EMPTY_ICON_SIZE,};use crate::termwindow::ui::tokens::{SIDEBAR_ICON_GAP, SIDEBAR_INSET, SIDEBAR_ROW_RADIUS, TAB_ICON_GLYPH_RATIO,@@ -88,7 +89,6 @@ impl TermWindow {content_top: usize,content_width: usize,status: Option<&str>,- has_agents: bool,) -> anyhow::Result<()> {let cell_height = ui_metrics.cell_size.height as usize;let button_height = self.agents_toolbar_button_height(cell_height);@@ -110,13 +110,13 @@ impl TermWindow {// The line to the left of that button, only when there is something// to say: a reload acknowledgement while it lives, because it is the- // answer to the click that just happened, or why the list is empty.- // A running count would only repeat the group headings, cut short.+ // answer to the click that just happened, or that detection is off.+ // An empty list says so in the panel's middle instead. A running+ // count would only repeat the group headings, cut short.let detection_on = agent_status::enabled();let line = match status {Some(status) => status.to_string(),None if !detection_on => crate::i18n::tr("right-agents-detection-off"),- None if !has_agents => crate::i18n::tr("right-agents-none"),None => String::new(),};if status.is_some() {@@ -148,6 +148,96 @@ impl TermWindow {Ok(())}+ /// The panel with nothing in it: the tab's icon, a title and a line on+ /// what shows up here, centred like the remote Files panel's empty state.+ /// Agents are not all that lands in this list -- a program reporting its+ /// progress does too -- so the words do not say "agent" alone.+ #[allow(clippy::too_many_arguments)]+ fn paint_agents_empty_state(+ &mut self,+ layers: &mut TripleLayerQuadAllocator,+ ui_font: &Rc<LoadedFont>,+ ui_metrics: RenderMetrics,+ chrome: UiPalette,+ foreground: LinearRgba,+ font_size: f64,+ content_x: usize,+ content_top: usize,+ content_width: usize,+ content_bottom: usize,+ ) -> anyhow::Result<()> {+ // The card titles' semibold, so the title reads as one.+ let title_font = self+ .fonts+ .title_font_with_size_and_weight(font_size, 600)+ .context("agents empty state title font")?;+ let title_metrics = RenderMetrics::with_font_metrics(&title_font.metrics());+ let title_h = title_metrics.cell_size.height as usize;+ let line_h = ui_metrics.cell_size.height as usize;+ let icon_size = self.ui_px(REMOTE_EMPTY_ICON_SIZE);+ let icon_gap = self.ui_px(REMOTE_EMPTY_ICON_GAP);+ let detail_gap = self.ui_px(REMOTE_EMPTY_DETAIL_GAP);+ // Narrower than the panel, so the explanation sets as a short block+ // instead of running edge to edge.+ let text_width = content_width+ .saturating_sub(self.ui_px(SIDEBAR_INSET) * 4)+ .max(1);++ let title = crate::i18n::tr("right-agents-empty-title");+ let detail = crate::i18n::tr("right-agents-empty-detail");+ let (title_lines, detail_lines) = {+ let wrap = |font: &Rc<LoadedFont>, text: &str| {+ wrap_at_line_breaks(text, |line| {+ self.sidebar_text_width(font, line).unwrap_or(f32::MAX) <= text_width as f32+ })+ };+ (wrap(&title_font, &title), wrap(ui_font, &detail))+ };++ let block_h = icon_size+ + icon_gap+ + title_lines.len() * title_h+ + detail_gap+ + detail_lines.len() * line_h;+ // Centre in the panel, but never above its top edge when short.+ let available = content_bottom.saturating_sub(content_top);+ let mut y = content_top + available.saturating_sub(block_h) / 2;++ let icon_x = content_x + content_width.saturating_sub(icon_size) / 2;+ // Faint, like the line under the title: the title is what reads first.+ self.paint_sidebar_icon(layers, SvgIcon::Eye, icon_x, y, icon_size, chrome.muted_text)?;+ y += icon_size + icon_gap;++ for line in &title_lines {+ self.paint_remote_files_centered_text(+ layers,+ &title_font,+ title_metrics,+ line,+ content_x,+ y,+ content_width,+ foreground,+ )?;+ y += title_h;+ }+ y += detail_gap;+ for line in &detail_lines {+ self.paint_remote_files_centered_text(+ layers,+ ui_font,+ ui_metrics,+ line,+ content_x,+ y,+ content_width,+ chrome.muted_text,+ )?;+ y += line_h;+ }+ Ok(())+ }+#[allow(clippy::too_many_arguments)]pub(crate) fn paint_agents_sidebar(&mut self,@@ -190,11 +280,7 @@ impl TermWindow {self.right_sidebar_agents_list = None;self.right_sidebar_agents_fitted.clear();self.right_sidebar_agents_open_subtasks.clear();- // Nothing but the toolbar: an empty-state card here is a large- // bordered box explaining that a list is empty, which the- // toolbar line already says in one row. The panel reads as- // quiet rather than broken.- return self.paint_agents_toolbar(+ self.paint_agents_toolbar(layers,ui_font,ui_metrics,@@ -205,8 +291,24 @@ impl TermWindow {content_top,content_width,status.as_deref(),- has_agents,- );+ )?;+ // With detection off the toolbar line says so and leads to the+ // switch; there is nothing to wait for, so no empty state.+ if agent_status::enabled() {+ self.paint_agents_empty_state(+ layers,+ ui_font,+ ui_metrics,+ chrome,+ foreground,+ font_size,+ content_x,+ content_top,+ content_width,+ content_bottom,+ )?;+ }+ return Ok(());}// The view menu's choices: what is hidden, then how the rest is@@ -983,7 +1085,6 @@ impl TermWindow {content_top,content_width,status.as_deref(),- has_agents,)?;if scrolled {let fade_height = self@@ -2307,9 +2408,45 @@ fn agent_row_visible_band(})}+/// `text` as lines that each `fits`, broken where Unicode allows: between+/// words, and between the characters of a script written without spaces, so+/// Chinese and Japanese wrap as evenly as English and no line starts with+/// ",". A piece too wide for a line on its own is left whole.+fn wrap_at_line_breaks(text: &str, mut fits: impl FnMut(&str) -> bool) -> Vec<String> {+ let mut lines = Vec::new();+ let mut line_start = 0;+ let mut last_break = 0;+ for (at, _) in unicode_linebreak::linebreaks(text) {+ if last_break > line_start && !fits(text[line_start..at].trim_end()) {+ lines.push(text[line_start..last_break].trim_end().to_string());+ line_start = last_break;+ }+ last_break = at;+ }+ if line_start < text.len() {+ lines.push(text[line_start..].trim_end().to_string());+ }+ lines+}+#[cfg(test)]mod tests {- use super::{agent_row_visible_band, AgentRowBand, ShimmerBand};+ use super::{agent_row_visible_band, wrap_at_line_breaks, AgentRowBand, ShimmerBand};++ #[test]+ fn chinese_wraps_between_characters_and_never_starts_a_line_with_a_comma() {+ // Eight characters a line, whatever the script.+ let lines = wrap_at_line_breaks("在终端里运行程序,它们会显示在这里。", |line| {+ line.chars().count() <= 8+ });+ assert_eq!(lines, ["在终端里运行程", "序,它们会显示在", "这里。"]);+ }++ #[test]+ fn english_wraps_between_words() {+ let lines = wrap_at_line_breaks("show up here once they run", |line| line.len() <= 12);+ assert_eq!(lines, ["show up here", "once they", "run"]);+ }const H: usize = 52;const TOP: usize = 100;diff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rsindex 8cce148d..c4af0798 100644--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs@@ -151,10 +151,11 @@ const PREVIEW_OPEN_BUTTON_MIN: usize = 80;/// Narrower than this and the "Open With" button drops its dropdown arrow.const PREVIEW_OPEN_SPLIT_MIN_WIDTH: usize = 112;const PREVIEW_OPEN_ARROW_WIDTH: usize = 36;-/// Empty-state geometry for the remote Files panel, in design pixels.-const REMOTE_EMPTY_ICON_SIZE: usize = 40;-const REMOTE_EMPTY_ICON_GAP: usize = 18;-const REMOTE_EMPTY_DETAIL_GAP: usize = 6;+/// Empty-state geometry for the remote Files panel, in design pixels. The+/// Status panel's empty state uses it too.+pub(crate) const REMOTE_EMPTY_ICON_SIZE: usize = 40;+pub(crate) const REMOTE_EMPTY_ICON_GAP: usize = 18;+pub(crate) const REMOTE_EMPTY_DETAIL_GAP: usize = 6;const REMOTE_EMPTY_BUTTON_GAP: usize = 22;const REMOTE_EMPTY_BUTTON_HEIGHT: usize = 44;/// Toolbar control height.@@ -13833,7 +13834,7 @@ impl crate::TermWindow {/// Horizontally centre a single line, falling back to the full width (and/// therefore ellipsizing) only when the text cannot fit.#[allow(clippy::too_many_arguments)]- fn paint_remote_files_centered_text(+ pub(crate) fn paint_remote_files_centered_text(&mut self,layers: &mut TripleLayerQuadAllocator,ui_font: &Rc<LoadedFont>,