From 7d6e766027b610051fd315e3de8d3ea19f854f6e Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Thu, 9 Apr 2026 16:23:16 +0200 Subject: [PATCH] fix(cli): fallback to plain prompt on VTE terminals with broken emoji width (#8385) Signed-off-by: Vincenzo Palazzo Signed-off-by: Douwe Osinga Co-authored-by: Douwe Osinga --- crates/goose-cli/src/session/input.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/goose-cli/src/session/input.rs b/crates/goose-cli/src/session/input.rs index 7265cc4d..af9db363 100644 --- a/crates/goose-cli/src/session/input.rs +++ b/crates/goose-cli/src/session/input.rs @@ -400,9 +400,23 @@ fn parse_plan_command(input: String) -> Option { } fn get_input_prompt_string() -> String { + if is_vte_with_broken_emoji_width() { + return "> ".to_string(); + } "🪿 ".to_string() } +/// VTE < 0.70 renders 🪿 as 1 cell while unicode-width counts 2, causing cursor offset. +fn is_vte_with_broken_emoji_width() -> bool { + let Ok(vte_version) = std::env::var("VTE_VERSION") else { + return false; + }; + let Ok(version) = vte_version.parse::() else { + return true; + }; + version < 7000 +} + fn print_help() { let newline_key = get_newline_key().to_ascii_uppercase(); let modes = GooseMode::VARIANTS.join(", ");