fix(render): replace SMP emoji with stable BMP glyphs to fix layout on Windows terminals
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
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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}")
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user