Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Use Option symbol for mac key hints (#5582)

Josh McKinneye258f0f0441c
diff --git a/codex-rs/tui/src/key_hint.rs b/codex-rs/tui/src/key_hint.rs
index b79c2a2703..795d1545f8 100644
--- a/codex-rs/tui/src/key_hint.rs
+++ b/codex-rs/tui/src/key_hint.rs
@@ -6,6 +6,9 @@ use ratatui::style::Style;
use ratatui::style::Stylize;
use ratatui::text::Span;
+#[cfg(target_os = "macos")]
+const ALT_PREFIX: &str = "⌥ + ";
+#[cfg(not(target_os = "macos"))]
const ALT_PREFIX: &str = "alt + ";
const CTRL_PREFIX: &str = "ctrl + ";
const SHIFT_PREFIX: &str = "shift + ";
diff --git a/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages@macos.snap b/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages@macos.snap
new file mode 100644
index 0000000000..5974455c89
--- /dev/null
+++ b/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages@macos.snap
@@ -0,0 +1,13 @@
+---
+source: tui/src/status_indicator_widget.rs
+assertion_line: 289
+expression: terminal.backend()
+---
+"• Working (0s • esc to interrupt) "
+" "
+" ↳ first "
+" ↳ second "
+" ⌥ + ↑ edit "
+" "
+" "
+" "
diff --git a/codex-rs/tui/src/status_indicator_widget.rs b/codex-rs/tui/src/status_indicator_widget.rs
index 4bcc5cf267..81efde71f2 100644
--- a/codex-rs/tui/src/status_indicator_widget.rs
+++ b/codex-rs/tui/src/status_indicator_widget.rs
@@ -284,6 +284,11 @@ mod tests {
terminal
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
.expect("draw");
+ #[cfg(target_os = "macos")]
+ insta::with_settings!({ snapshot_suffix => "macos" }, {
+ insta::assert_snapshot!(terminal.backend());
+ });
+ #[cfg(not(target_os = "macos"))]
insta::assert_snapshot!(terminal.backend());
}