From 4c46490e53076e807fd2068aa68c5a0e636d8b5f Mon Sep 17 00:00:00 2001 From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:48:41 -0700 Subject: [PATCH] Highlight Proposed Command preview (#3319) #### Summary - highlight proposed command previews with the shared bash syntax highlighter - keep the Proposed Command section consistent with other execution renderings --- codex-rs/tui/src/history_cell.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index 8dd9154c..d65530b1 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -1177,13 +1177,14 @@ pub(crate) fn new_proposed_command(command: &[String]) -> PlainHistoryCell { let mut lines: Vec> = Vec::new(); lines.push(Line::from(vec!["• ".into(), "Proposed Command".bold()])); - let cmd_lines: Vec> = cmd - .lines() - .map(|part| Line::from(part.to_string())) - .collect(); + let highlighted_lines = crate::render::highlight::highlight_bash_to_lines(&cmd); let initial_prefix: Span<'static> = " └ ".dim(); let subsequent_prefix: Span<'static> = " ".into(); - lines.extend(prefix_lines(cmd_lines, initial_prefix, subsequent_prefix)); + lines.extend(prefix_lines( + highlighted_lines, + initial_prefix, + subsequent_prefix, + )); PlainHistoryCell { lines } }