From 5a66e6b70ccae4e55b66c596fb0cb5ccf128b5a0 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 11 Nov 2025 12:33:57 +0000 Subject: [PATCH] Fix some stuff --- .../core/src/unified_exec/session_manager.rs | 2 +- codex-rs/tui/src/exec_cell/render.rs | 42 +------------------ 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/codex-rs/core/src/unified_exec/session_manager.rs b/codex-rs/core/src/unified_exec/session_manager.rs index 4c8cbb1d46..8dcb663bac 100644 --- a/codex-rs/core/src/unified_exec/session_manager.rs +++ b/codex-rs/core/src/unified_exec/session_manager.rs @@ -507,7 +507,7 @@ mod tests { ]; let rendered = render_stdin_events(&events); - assert_eq!(rendered, "first\nsecond"); + assert_eq!(rendered, "first\n> [no output]\nsecond\n> out"); } #[test] diff --git a/codex-rs/tui/src/exec_cell/render.rs b/codex-rs/tui/src/exec_cell/render.rs index 4e44f43de6..5e538f1c25 100644 --- a/codex-rs/tui/src/exec_cell/render.rs +++ b/codex-rs/tui/src/exec_cell/render.rs @@ -23,7 +23,7 @@ use textwrap::WordSplitter; use unicode_width::UnicodeWidthStr; pub(crate) const TOOL_CALL_MAX_LINES: usize = 5; -const USER_SHELL_TOOL_CALL_MAX_LINES: usize = usize::MAX; +const USER_SHELL_TOOL_CALL_MAX_LINES: usize = 50; pub(crate) struct OutputLinesParams { pub(crate) line_limit: usize, @@ -524,44 +524,6 @@ struct ExecDisplayLayout { output_max_lines: usize, } -#[cfg(test)] -mod tests { - use super::*; - use pretty_assertions::assert_eq; - - #[test] - fn user_shell_output_shows_all_lines() { - let aggregated_output = (0..12) - .map(|idx| format!("line {idx}")) - .collect::>() - .join("\n"); - let command_output = CommandOutput { - exit_code: 0, - aggregated_output, - formatted_output: String::new(), - }; - - let output = output_lines( - Some(&command_output), - OutputLinesParams { - line_limit: USER_SHELL_TOOL_CALL_MAX_LINES, - only_err: false, - include_angle_pipe: true, - include_prefix: true, - }, - ); - - assert_eq!(output.lines.len(), 12); - assert!(output.omitted.is_none()); - assert!( - output - .lines - .iter() - .all(|line| line.spans.iter().all(|span| !span.content.contains('…'))) - ); - } -} - impl ExecDisplayLayout { const fn new( command_continuation: PrefixedBlock, @@ -583,4 +545,4 @@ const EXEC_DISPLAY_LAYOUT: ExecDisplayLayout = ExecDisplayLayout::new( 2, PrefixedBlock::new(" └ ", " "), 5, -); +); \ No newline at end of file