Use Option symbol for mac key hints (#5582)
## Summary - show the Option (⌥) symbol in key hints when the TUI is built for macOS so the shortcut text matches the platform terminology ## Testing - cargo test -p codex-tui ------ https://chatgpt.com/codex/tasks/task_i_68fab7505530832992780a9e13fb707b
This commit is contained in:
@@ -6,6 +6,9 @@ use ratatui::style::Style;
|
|||||||
use ratatui::style::Stylize;
|
use ratatui::style::Stylize;
|
||||||
use ratatui::text::Span;
|
use ratatui::text::Span;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
const ALT_PREFIX: &str = "⌥ + ";
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
const ALT_PREFIX: &str = "alt + ";
|
const ALT_PREFIX: &str = "alt + ";
|
||||||
const CTRL_PREFIX: &str = "ctrl + ";
|
const CTRL_PREFIX: &str = "ctrl + ";
|
||||||
const SHIFT_PREFIX: &str = "shift + ";
|
const SHIFT_PREFIX: &str = "shift + ";
|
||||||
|
|||||||
@@ -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 "
|
||||||
|
" "
|
||||||
|
" "
|
||||||
|
" "
|
||||||
@@ -284,6 +284,11 @@ mod tests {
|
|||||||
terminal
|
terminal
|
||||||
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
|
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
|
||||||
.expect("draw");
|
.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());
|
insta::assert_snapshot!(terminal.backend());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user