Lightweight coding agent that runs in your terminal
Rust
fix emoji spacing (#2735)
Jeremy Roseb367790d9b96
diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_exec_marks_failed.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_exec_marks_failed.snapindex 7f15f49bd1..1554e94f15 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_exec_marks_failed.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_exec_marks_failed.snap@@ -3,4 +3,4 @@ source: tui/src/chatwidget/tests.rsexpression: exec_blob--->_- ✗ ⌨️ sleep 1+ ✗ ⌨️ sleep 1diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rsindex 6f939c626a..a92fb0e49c 100644--- a/codex-rs/tui/src/chatwidget/tests.rs+++ b/codex-rs/tui/src/chatwidget/tests.rs@@ -1246,7 +1246,7 @@ fn stream_error_is_rendered_to_history() {let cells = drain_insert_history(&mut rx);assert!(!cells.is_empty(), "expected a history cell for StreamError");let blob = lines_to_single_string(cells.last().unwrap());- assert!(blob.contains("⚠ "));+ assert!(blob.contains("⚠\u{200A} "));assert!(blob.contains("stream error:"));assert!(blob.contains("idle timeout waiting for SSE"));}diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rsindex f7c257d3ab..6d059a4ced 100644--- a/codex-rs/tui/src/history_cell.rs+++ b/codex-rs/tui/src/history_cell.rs@@ -230,14 +230,11 @@ fn pretty_provider_name(id: &str) -> String {title_case(id)}}-/// Return the emoji followed by a hair space (U+200A) and a normal space.-/// This creates a reasonable gap across different terminals,-/// in particular Terminal.app and iTerm, which render too tightly with just a single normal space.-///-/// Improvements here could be to condition this behavior on terminal,-/// or possibly on emoji.+/// Return the emoji followed by a hair space (U+200A).+/// Using only the hair space avoids excessive padding after the emoji while+/// still providing a small visual gap across terminals.fn padded_emoji(emoji: &str) -> String {- format!("{emoji}\u{200A} ")+ format!("{emoji}\u{200A}")}/// Convenience function over `padded_emoji()`.@@ -900,14 +897,19 @@ pub(crate) fn new_error_event(message: String) -> PlainHistoryCell {// in terminals like Ghostty.let lines: Vec<Line<'static>> = vec!["".into(),- vec![padded_emoji("🖐").red().bold(), message.into()].into(),+ vec![padded_emoji("🖐").red().bold(), " ".into(), message.into()].into(),];PlainHistoryCell { lines }}pub(crate) fn new_stream_error_event(message: String) -> PlainHistoryCell {let lines: Vec<Line<'static>> = vec![- vec![padded_emoji("⚠").magenta().bold(), message.dim()].into(),+ vec![+ padded_emoji("⚠").magenta().bold(),+ " ".into(),+ message.dim(),+ ]+ .into(),"".into(),];PlainHistoryCell { lines }