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
---
• Ran sleep 1
└ (no output)

View File

@@ -366,26 +366,35 @@ impl ExecCell {
include_prefix: false,
},
);
let trimmed_output =
Self::truncate_lines_middle(&raw_output_lines, layout.output_max_lines);
let mut wrapped_output: Vec<Line<'static>> = Vec::new();
let output_wrap_width = layout.output_block.wrap_width(width);
let output_opts =
RtOptions::new(output_wrap_width).word_splitter(WordSplitter::NoHyphenation);
for line in trimmed_output {
push_owned_lines(
&word_wrap_line(&line, output_opts.clone()),
&mut wrapped_output,
);
}
if !wrapped_output.is_empty() {
if raw_output_lines.is_empty() {
lines.extend(prefix_lines(
wrapped_output,
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 =
Self::truncate_lines_middle(&raw_output_lines, layout.output_max_lines);
let mut wrapped_output: Vec<Line<'static>> = Vec::new();
let output_wrap_width = layout.output_block.wrap_width(width);
let output_opts =
RtOptions::new(output_wrap_width).word_splitter(WordSplitter::NoHyphenation);
for line in trimmed_output {
push_owned_lines(
&word_wrap_line(&line, output_opts.clone()),
&mut wrapped_output,
);
}
if !wrapped_output.is_empty() {
lines.extend(prefix_lines(
wrapped_output,
Span::from(layout.output_block.initial_prefix).dim(),
Span::from(layout.output_block.subsequent_prefix),
));
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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