From 4bc5375fa6837114dab1e8bfded7428ac2a15785 Mon Sep 17 00:00:00 2001 From: AutoGHClaw Date: Mon, 11 May 2026 11:34:04 -0400 Subject: [PATCH] fix(render): replace SMP emoji with stable BMP glyphs to fix layout on Windows terminals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emoji in U+1F000+ have no stable column-width contract across terminal emulators. On cmd.exe/PowerShell they render as 1-column placeholder boxes even though unicode_width reports 2; on WezTerm/Alacritty with certain font stacks the rendered width can be off by one column. Both cases break layout arithmetic in the header and file-tree widgets. Changes: - header.rs: replace 🐳 (U+1F433, 2-wide) with ◆ (U+25C6, always 1-wide) in the "max" reasoning-effort chip - file_tree.rs: drop the 📁/📄 (U+1F4C1/U+1F4C4) entry-icon prefix; the ▼/▶ expand marker already distinguishes dirs from files Fixes #1314 --- crates/tui/src/tui/file_tree.rs | 10 ++++------ crates/tui/src/tui/widgets/header.rs | 5 ++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/tui/src/tui/file_tree.rs b/crates/tui/src/tui/file_tree.rs index a5b7da6e..9a1309cf 100644 --- a/crates/tui/src/tui/file_tree.rs +++ b/crates/tui/src/tui/file_tree.rs @@ -333,14 +333,12 @@ pub fn render_file_tree( } else { " " }; - let icon = if entry.is_dir { - "\u{1F4C1} " - } else { - "\u{1F4C4} " - }; // 📁 / 📄 + // No separate icon: the ▼/▶ expand marker already signals dirs, + // and SMP emoji (📁/📄, U+1F4C1/U+1F4C4) render at inconsistent + // column widths across terminals, breaking layout. See issue #1314. // Build the display text. - let raw = format!("{indent}{expand_marker}{icon}{}", entry.name); + let raw = format!("{indent}{expand_marker}{}", entry.name); let display = truncate_line_to_width(&raw, content_width.max(1)); let style = if is_selected { diff --git a/crates/tui/src/tui/widgets/header.rs b/crates/tui/src/tui/widgets/header.rs index 438abb50..d05993be 100644 --- a/crates/tui/src/tui/widgets/header.rs +++ b/crates/tui/src/tui/widgets/header.rs @@ -250,7 +250,10 @@ impl<'a> HeaderWidget<'a> { let body = if !include_prefix { trimmed.to_string() } else if trimmed.eq_ignore_ascii_case("max") || trimmed.eq_ignore_ascii_case("maximum") { - format!("\u{1F433} {trimmed}") + // Use a non-emoji diamond (U+25C6, always 1 column) instead of an + // SMP emoji whose rendered width is inconsistent across terminals + // (cmd/PowerShell, WezTerm, Alacritty). See issue #1314. + format!("\u{25C6} {trimmed}") } else { format!("\u{00B7} {trimmed}") };