From eb1551879b6072eaab17051713dc20f925ef2b1f Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Fri, 5 Jun 2026 14:13:58 -0300 Subject: [PATCH] fix(tui): preserve shell display semantics --- codex-rs/shell-command/src/bash.rs | 50 ++++++++++++++++++- codex-rs/tui/src/chatwidget.rs | 2 +- .../tui/src/chatwidget/command_lifecycle.rs | 2 +- codex-rs/tui/src/exec_cell/render.rs | 36 +++++++------ codex-rs/tui/src/exec_command.rs | 27 ++++++++-- 5 files changed, 94 insertions(+), 23 deletions(-) diff --git a/codex-rs/shell-command/src/bash.rs b/codex-rs/shell-command/src/bash.rs index 0dee5fa366..06b21f1415 100644 --- a/codex-rs/shell-command/src/bash.rs +++ b/codex-rs/shell-command/src/bash.rs @@ -120,7 +120,8 @@ fn is_recognised_bash_lc_invocation(shell: &str, flag: &str) -> bool { /// Like `extract_bash_command`, but also recognises argv where the inner /// script was flattened past `[shell, flag, script]` (e.g. the protocol /// payload re-split an unquoted form into `[shell, flag, word, word, ...]`). -/// Returns an owned script, shlex-joined across the tail. +/// Returns an owned script reconstructed across the tail. Ordinary arguments +/// are shell-quoted, while standalone shell operator tokens remain operators. /// /// Caveat: this assumes every token after the flag is script text, so it is /// deliberately wrong for POSIX `sh -c