Show placeholder for commands with no output (#4509)

## Summary
- show a dim “(no output)” placeholder when an executed command produces
no stdout or stderr so empty runs are visible
- update TUI snapshots to include the new placeholder in history
renderings

## Testing
- cargo test -p codex-tui


------
https://chatgpt.com/codex/tasks/task_i_68dc056c1d5883218fe8d9929e9b1657
This commit is contained in:
Ahmed Ibrahim
2025-10-01 10:42:30 -07:00
committed by GitHub
parent d78d0764aa
commit 751b3b50ac
7 changed files with 30 additions and 15 deletions

View File

@@ -3,3 +3,4 @@ source: tui/src/chatwidget/tests.rs
expression: exec_blob expression: exec_blob
--- ---
• Ran sleep 1 • Ran sleep 1
└ (no output)

View File

@@ -366,6 +366,14 @@ impl ExecCell {
include_prefix: false, include_prefix: false,
}, },
); );
if raw_output_lines.is_empty() {
lines.extend(prefix_lines(
vec![Line::from("(no output)".dim())],
Span::from(layout.output_block.initial_prefix).dim(),
Span::from(layout.output_block.subsequent_prefix),
));
} else {
let trimmed_output = let trimmed_output =
Self::truncate_lines_middle(&raw_output_lines, layout.output_max_lines); Self::truncate_lines_middle(&raw_output_lines, layout.output_max_lines);
@@ -388,6 +396,7 @@ impl ExecCell {
)); ));
} }
} }
}
lines lines
} }

View File

@@ -6,3 +6,4 @@ expression: rendered
│ ough_to_wrap │ ough_to_wrap
│ second_token_is_also_lon │ second_token_is_also_lon
│ … +1 lines │ … +1 lines
└ (no output)

View File

@@ -4,3 +4,4 @@ expression: rendered
--- ---
• Ran echo one • Ran echo one
│ echo two │ echo two
└ (no output)

View File

@@ -5,3 +5,4 @@ expression: rendered
• Ran set -o pipefail • Ran set -o pipefail
│ cargo test │ cargo test
│ --all-features --quiet │ --all-features --quiet
└ (no output)

View File

@@ -3,3 +3,4 @@ source: tui/src/history_cell.rs
expression: rendered expression: rendered
--- ---
• Ran echo ok • Ran echo ok
└ (no output)

View File

@@ -5,3 +5,4 @@ expression: rendered
• Ran a_very_long_token_ • Ran a_very_long_token_
│ without_spaces_to_ │ without_spaces_to_
│ force_wrapping │ force_wrapping
└ (no output)