mirror of
https://github.com/openai/codex.git
synced 2026-04-28 00:25:56 +00:00
Move TUI on top of app server (parallel code) (#14717)
This PR replicates the `tui` code directory and creates a temporary parallel `tui_app_server` directory. It also implements a new feature flag `tui_app_server` to select between the two tui implementations. Once the new app-server-based TUI is stabilized, we'll delete the old `tui` directory and feature flag.
This commit is contained in:
24
codex-rs/tui_app_server/tests/suite/status_indicator.rs
Normal file
24
codex-rs/tui_app_server/tests/suite/status_indicator.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
//! Regression test: ensure that `StatusIndicatorWidget` sanitises ANSI escape
|
||||
//! sequences so that no raw `\x1b` bytes are written into the backing
|
||||
//! buffer. Rendering logic is tricky to unit‑test end‑to‑end, therefore we
|
||||
//! verify the *public* contract of `ansi_escape_line()` which the widget now
|
||||
//! relies on.
|
||||
|
||||
use codex_ansi_escape::ansi_escape_line;
|
||||
|
||||
#[test]
|
||||
fn ansi_escape_line_strips_escape_sequences() {
|
||||
let text_in_ansi_red = "\x1b[31mRED\x1b[0m";
|
||||
|
||||
// The returned line must contain three printable glyphs and **no** raw
|
||||
// escape bytes.
|
||||
let line = ansi_escape_line(text_in_ansi_red);
|
||||
|
||||
let combined: String = line
|
||||
.spans
|
||||
.iter()
|
||||
.map(|span| span.content.to_string())
|
||||
.collect();
|
||||
|
||||
assert_eq!(combined, "RED");
|
||||
}
|
||||
Reference in New Issue
Block a user