diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index 443c54aa..3658dc7e 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -264,14 +264,21 @@ impl HistoryCell { pub(crate) fn new_active_exec_command(command: Vec) -> Self { let command_escaped = strip_bash_lc_and_escape(&command); - let lines: Vec> = vec![ - Line::from(vec![ + let mut lines: Vec> = Vec::new(); + let mut iter = command_escaped.lines(); + if let Some(first) = iter.next() { + lines.push(Line::from(vec![ "▌ ".cyan(), "Running command ".magenta(), - command_escaped.into(), - ]), - Line::from(""), - ]; + first.to_string().into(), + ])); + } else { + lines.push(Line::from(vec!["▌ ".cyan(), "Running command".magenta()])); + } + for cont in iter { + lines.push(Line::from(cont.to_string())); + } + lines.push(Line::from("")); HistoryCell::ActiveExecCommand { view: TextBlock::new(lines), @@ -287,10 +294,18 @@ impl HistoryCell { let mut lines: Vec> = Vec::new(); let command_escaped = strip_bash_lc_and_escape(&command); - lines.push(Line::from(vec![ - "⚡ Ran command ".magenta(), - command_escaped.into(), - ])); + let mut cmd_lines = command_escaped.lines(); + if let Some(first) = cmd_lines.next() { + lines.push(Line::from(vec![ + "⚡ Ran command ".magenta(), + first.to_string().into(), + ])); + } else { + lines.push(Line::from("⚡ Ran command".magenta())); + } + for cont in cmd_lines { + lines.push(Line::from(cont.to_string())); + } let src = if exit_code == 0 { stdout } else { stderr };