From 2f0bc514b792f4acd11a8dbaed85d90881f22455 Mon Sep 17 00:00:00 2001 From: Abhishek Bhardwaj Date: Fri, 12 Sep 2025 22:33:09 -0700 Subject: [PATCH] feature: Add "!cmd" user shell execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - protocol: add Op::RunUserShellCommand to model a user-initiated one-off command - core: handle new Op by spawning a cancellable task that runs the command using the user’s default shell; stream output via ExecCommand* events; send TaskStarted/TaskComplete; track as current_task so Interrupt works - tui: detect leading '!' in composer submission and dispatch Op::RunUserShellCommand instead of sending a user message No changes to sandbox env var behavior; uses existing exec pipeline and event types. --- codex-rs/core/src/codex.rs | 103 ++++++++++++++ codex-rs/core/src/shell.rs | 40 +++++- codex-rs/core/tests/suite/mod.rs | 1 + codex-rs/core/tests/suite/user_shell_cmd.rs | 134 ++++++++++++++++++ .../src/event_processor_with_human_output.rs | 1 + codex-rs/protocol/src/protocol.rs | 14 ++ codex-rs/tui/src/chatwidget.rs | 32 ++++- codex-rs/tui/src/chatwidget/tests.rs | 3 + codex-rs/tui/src/history_cell.rs | 40 +++++- codex-rs/tui/src/pager_overlay.rs | 1 + 10 files changed, 352 insertions(+), 17 deletions(-) create mode 100644 codex-rs/core/tests/suite/user_shell_cmd.rs diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 84a04d7533..d1a3d9a801 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -135,6 +135,7 @@ use codex_protocol::models::ResponseInputItem; use codex_protocol::models::ResponseItem; use codex_protocol::models::ShellToolCallParams; use codex_protocol::protocol::InitialHistory; +use uuid::Uuid; pub mod compact; use self::compact::build_compacted_history; @@ -812,6 +813,7 @@ impl Session { command_for_display, cwd, apply_patch, + is_user_shell_command, } = exec_command_context; let msg = match apply_patch { Some(ApplyPatchCommandContext { @@ -834,6 +836,7 @@ impl Session { .into_iter() .map(Into::into) .collect(), + is_user_shell_command, }), }; let event = Event { @@ -1063,6 +1066,7 @@ pub(crate) struct ExecCommandContext { pub(crate) command_for_display: Vec, pub(crate) cwd: PathBuf, pub(crate) apply_patch: Option, + pub(crate) is_user_shell_command: bool, } #[derive(Clone, Debug)] @@ -1518,6 +1522,9 @@ async fn submission_loop( }; sess.send_event(event).await; } + Op::RunUserShellCommand { command } => { + spawn_user_shell_command_task(sess.clone(), &turn_context, sub.id, command).await; + } Op::Review { review_request } => { spawn_review_thread( sess.clone(), @@ -1536,6 +1543,101 @@ async fn submission_loop( debug!("Agent loop exited"); } +async fn spawn_user_shell_command_task( + sess: Arc, + turn_context: &Arc, + sub_id: String, + command: String, +) { + let handle = { + let sess = sess.clone(); + let turn_context = turn_context.clone(); + let spawn_sub_id = sub_id.clone(); + tokio::spawn(async move { + run_user_shell_command(sess, turn_context, spawn_sub_id, command).await; + }) + .abort_handle() + }; + + sess.set_task(AgentTask { + sess: sess.clone(), + sub_id, + handle, + kind: AgentTaskKind::Regular, + }) + .await; +} + +async fn run_user_shell_command( + sess: Arc, + turn_context: Arc, + sub_id: String, + command: String, +) { + let event = Event { + id: sub_id.clone(), + msg: EventMsg::TaskStarted(TaskStartedEvent { + model_context_window: turn_context.client.get_model_context_window(), + }), + }; + sess.send_event(event).await; + + let shell_invocation = sess + .user_shell + .format_user_shell_script(&command) + .unwrap_or_else(|| vec![command.clone()]); + + let params = ExecParams { + command: shell_invocation.clone(), + cwd: turn_context.cwd.clone(), + timeout_ms: None, + env: create_env(&turn_context.shell_environment_policy), + with_escalated_permissions: None, + justification: None, + }; + + let mut turn_diff_tracker = TurnDiffTracker::new(); + let call_id = Uuid::new_v4().to_string(); + + let exec_ctx = ExecCommandContext { + sub_id: sub_id.clone(), + call_id: call_id.clone(), + command_for_display: shell_invocation, + cwd: params.cwd.clone(), + apply_patch: None, + is_user_shell_command: true, + }; + + let sandbox_policy = SandboxPolicy::DangerFullAccess; + + let _ = sess + .run_exec_with_events( + &mut turn_diff_tracker, + exec_ctx, + ExecInvokeArgs { + params, + sandbox_type: SandboxType::None, + sandbox_policy: &sandbox_policy, + sandbox_cwd: &turn_context.cwd, + codex_linux_sandbox_exe: &sess.codex_linux_sandbox_exe, + stdout_stream: Some(StdoutStream { + sub_id: sub_id.clone(), + call_id: call_id.clone(), + tx_event: sess.tx_event.clone(), + }), + }, + ) + .await; + + let complete = Event { + id: sub_id, + msg: EventMsg::TaskComplete(TaskCompleteEvent { + last_agent_message: None, + }), + }; + sess.send_event(complete).await; +} + /// Spawn a review thread using the given prompt. async fn spawn_review_thread( sess: Arc, @@ -2800,6 +2902,7 @@ async fn handle_container_exec_with_params( changes: convert_apply_patch_to_protocol(&action), }, ), + is_user_shell_command: false, }; let params = maybe_translate_shell_command(params, sess, turn_context); diff --git a/codex-rs/core/src/shell.rs b/codex-rs/core/src/shell.rs index ac93d8b12e..decf27644d 100644 --- a/codex-rs/core/src/shell.rs +++ b/codex-rs/core/src/shell.rs @@ -30,6 +30,28 @@ pub enum Shell { } impl Shell { + pub fn format_user_shell_script(&self, script: &str) -> Option> { + match self { + Shell::Zsh(zsh) => Some(format_shell_script_with_rc( + &zsh.shell_path, + &zsh.zshrc_path, + script, + )), + Shell::Bash(bash) => Some(format_shell_script_with_rc( + &bash.shell_path, + &bash.bashrc_path, + script, + )), + Shell::PowerShell(ps) => Some(vec![ + ps.exe.clone(), + "-NoProfile".to_string(), + "-Command".to_string(), + script.to_string(), + ]), + Shell::Unknown => None, + } + } + pub fn format_default_shell_invocation(&self, command: Vec) -> Option> { match self { Shell::Zsh(zsh) => format_shell_invocation_with_rc( @@ -113,13 +135,7 @@ fn format_shell_invocation_with_rc( let joined = strip_bash_lc(command) .or_else(|| shlex::try_join(command.iter().map(String::as_str)).ok())?; - let rc_command = if std::path::Path::new(rc_path).exists() { - format!("source {rc_path} && ({joined})") - } else { - joined - }; - - Some(vec![shell_path.to_string(), "-lc".to_string(), rc_command]) + Some(format_shell_script_with_rc(shell_path, rc_path, &joined)) } fn strip_bash_lc(command: &[String]) -> Option { @@ -135,6 +151,16 @@ fn strip_bash_lc(command: &[String]) -> Option { } } +fn format_shell_script_with_rc(shell_path: &str, rc_path: &str, script: &str) -> Vec { + let rc_command = if std::path::Path::new(rc_path).exists() { + format!("source {rc_path} && ({script})") + } else { + script.to_string() + }; + + vec![shell_path.to_string(), "-lc".to_string(), rc_command] +} + #[cfg(unix)] fn detect_default_user_shell() -> Shell { use libc::getpwuid; diff --git a/codex-rs/core/tests/suite/mod.rs b/codex-rs/core/tests/suite/mod.rs index 2d91e330a8..6886d2349d 100644 --- a/codex-rs/core/tests/suite/mod.rs +++ b/codex-rs/core/tests/suite/mod.rs @@ -17,3 +17,4 @@ mod seatbelt; mod stream_error_allows_next_turn; mod stream_no_completed; mod user_notification; +mod user_shell_cmd; diff --git a/codex-rs/core/tests/suite/user_shell_cmd.rs b/codex-rs/core/tests/suite/user_shell_cmd.rs new file mode 100644 index 0000000000..ff4503e87b --- /dev/null +++ b/codex-rs/core/tests/suite/user_shell_cmd.rs @@ -0,0 +1,134 @@ +use codex_core::ConversationManager; +use codex_core::NewConversation; +use codex_core::protocol::EventMsg; +use codex_core::protocol::ExecCommandEndEvent; +use codex_core::protocol::Op; +use codex_core::protocol::TurnAbortReason; +use core_test_support::load_default_config_for_test; +use core_test_support::wait_for_event; +use std::path::PathBuf; +use std::process::Command; +use std::process::Stdio; +use tempfile::TempDir; + +fn detect_python_executable() -> Option { + let candidates = ["python3", "python"]; + candidates.iter().find_map(|candidate| { + Command::new(candidate) + .arg("--version") + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status() + .ok() + .and_then(|status| status.success().then(|| (*candidate).to_string())) + }) +} + +#[tokio::test] +async fn user_shell_cmd_ls_and_cat_in_temp_dir() { + let Some(python) = detect_python_executable() else { + eprintln!("skipping test: python3 not found in PATH"); + return; + }; + + // Create a temporary working directory with a known file. + let cwd = TempDir::new().unwrap(); + let file_name = "hello.txt"; + let file_path: PathBuf = cwd.path().join(file_name); + let contents = "hello from bang test\n"; + tokio::fs::write(&file_path, contents) + .await + .expect("write temp file"); + + // Load config and pin cwd to the temp dir so ls/cat operate there. + let codex_home = TempDir::new().unwrap(); + let mut config = load_default_config_for_test(&codex_home); + config.cwd = cwd.path().to_path_buf(); + + let conversation_manager = + ConversationManager::with_auth(codex_core::CodexAuth::from_api_key("dummy")); + let NewConversation { + conversation: codex, + .. + } = conversation_manager + .new_conversation(config) + .await + .expect("create new conversation"); + + // 1) python should list the file + let list_cmd = format!( + "{python} -c \"import pathlib; print('\\n'.join(sorted(p.name for p in pathlib.Path('.').iterdir())))\"" + ); + codex + .submit(Op::RunUserShellCommand { command: list_cmd }) + .await + .unwrap(); + let msg = wait_for_event(&codex, |ev| matches!(ev, EventMsg::ExecCommandEnd(_))).await; + let EventMsg::ExecCommandEnd(ExecCommandEndEvent { + stdout, exit_code, .. + }) = msg + else { + unreachable!() + }; + assert_eq!(exit_code, 0); + assert!( + stdout.contains(file_name), + "ls output should include {file_name}, got: {stdout:?}" + ); + + // 2) python should print the file contents verbatim + let cat_cmd = format!( + "{python} -c \"import pathlib; print(pathlib.Path('{file_name}').read_text(), end='')\"" + ); + codex + .submit(Op::RunUserShellCommand { command: cat_cmd }) + .await + .unwrap(); + let msg = wait_for_event(&codex, |ev| matches!(ev, EventMsg::ExecCommandEnd(_))).await; + let EventMsg::ExecCommandEnd(ExecCommandEndEvent { + stdout, exit_code, .. + }) = msg + else { + unreachable!() + }; + assert_eq!(exit_code, 0); + assert_eq!(stdout, contents); +} + +#[tokio::test] +async fn user_shell_cmd_can_be_interrupted() { + let Some(python) = detect_python_executable() else { + eprintln!("skipping test: python3 not found in PATH"); + return; + }; + // Set up isolated config and conversation. + let codex_home = TempDir::new().unwrap(); + let config = load_default_config_for_test(&codex_home); + let conversation_manager = + ConversationManager::with_auth(codex_core::CodexAuth::from_api_key("dummy")); + let NewConversation { + conversation: codex, + .. + } = conversation_manager + .new_conversation(config) + .await + .expect("create new conversation"); + + // Start a long-running command and then interrupt it. + let sleep_cmd = format!("{python} -c \"import time; time.sleep(5)\""); + codex + .submit(Op::RunUserShellCommand { command: sleep_cmd }) + .await + .unwrap(); + + // Wait until it has started (ExecCommandBegin), then interrupt. + let _ = wait_for_event(&codex, |ev| matches!(ev, EventMsg::ExecCommandBegin(_))).await; + codex.submit(Op::Interrupt).await.unwrap(); + + // Expect a TurnAborted(Interrupted) notification. + let msg = wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnAborted(_))).await; + let EventMsg::TurnAborted(ev) = msg else { + unreachable!() + }; + assert_eq!(ev.reason, TurnAbortReason::Interrupted); +} diff --git a/codex-rs/exec/src/event_processor_with_human_output.rs b/codex-rs/exec/src/event_processor_with_human_output.rs index cb972bf93e..672b075e13 100644 --- a/codex-rs/exec/src/event_processor_with_human_output.rs +++ b/codex-rs/exec/src/event_processor_with_human_output.rs @@ -278,6 +278,7 @@ impl EventProcessor for EventProcessorWithHumanOutput { command, cwd, parsed_cmd: _, + is_user_shell_command: _, }) => { self.call_id_to_command.insert( call_id, diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index bf0b192548..573fee8e5b 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -176,6 +176,16 @@ pub enum Op { /// Request to shut down codex instance. Shutdown, + + /// Execute a user-initiated one-off shell command (triggered by "!cmd"). + /// + /// The command string is executed using the user's default shell and may + /// include shell syntax (pipes, redirects, etc.). Output is streamed via + /// `ExecCommand*` events and the UI regains control upon `TaskComplete`. + RunUserShellCommand { + /// The raw command string after '!' + command: String, + }, } /// Determines the conditions under which the user is consulted to approve @@ -1052,6 +1062,10 @@ pub struct ExecCommandBeginEvent { /// The command's working directory if not the default cwd for the agent. pub cwd: PathBuf, pub parsed_cmd: Vec, + /// True when this exec was initiated directly by the user (e.g. bang command), + /// not by the agent/model. Defaults to false for backwards compatibility. + #[serde(default)] + pub is_user_shell_command: bool, } #[derive(Debug, Clone, Deserialize, Serialize, TS)] diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index ec749f4b7b..9adb0225cb 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -114,10 +114,14 @@ use codex_git_tooling::restore_ghost_commit; const MAX_TRACKED_GHOST_COMMITS: usize = 20; +const BANG_COMMAND_HELP_TITLE: &str = "Prefix a command with ! to run it locally"; +const BANG_COMMAND_HELP_HINT: &str = "Example: !ls"; + // Track information about an in-flight exec command. struct RunningCommand { command: Vec, parsed_cmd: Vec, + is_user_shell_command: bool, } const RATE_LIMIT_WARNING_THRESHOLDS: [f64; 3] = [75.0, 90.0, 95.0]; @@ -617,9 +621,9 @@ impl ChatWidget { pub(crate) fn handle_exec_end_now(&mut self, ev: ExecCommandEndEvent) { let running = self.running_commands.remove(&ev.call_id); - let (command, parsed) = match running { - Some(rc) => (rc.command, rc.parsed_cmd), - None => (vec![ev.call_id.clone()], Vec::new()), + let (command, parsed, is_user_shell_command) = match running { + Some(rc) => (rc.command, rc.parsed_cmd, rc.is_user_shell_command), + None => (vec![ev.call_id.clone()], Vec::new(), false), }; let needs_new = self @@ -633,6 +637,7 @@ impl ChatWidget { ev.call_id.clone(), command, parsed, + is_user_shell_command, ))); } @@ -717,6 +722,7 @@ impl ChatWidget { RunningCommand { command: ev.command.clone(), parsed_cmd: ev.parsed_cmd.clone(), + is_user_shell_command: ev.is_user_shell_command, }, ); if let Some(cell) = self @@ -727,6 +733,7 @@ impl ChatWidget { ev.call_id.clone(), ev.command.clone(), ev.parsed_cmd.clone(), + ev.is_user_shell_command, ) { *cell = new_exec; @@ -737,6 +744,7 @@ impl ChatWidget { ev.call_id.clone(), ev.command.clone(), ev.parsed_cmd, + ev.is_user_shell_command, ))); } @@ -1171,6 +1179,24 @@ impl ChatWidget { let mut items: Vec = Vec::new(); + // Special-case: "!cmd" executes a local shell command instead of sending to the model. + if let Some(stripped) = text.strip_prefix('!') { + let cmd = stripped.trim(); + if cmd.is_empty() { + self.app_event_tx.send(AppEvent::InsertHistoryCell(Box::new( + history_cell::new_info_event( + BANG_COMMAND_HELP_TITLE.to_string(), + Some(BANG_COMMAND_HELP_HINT.to_string()), + ), + ))); + return; + } + self.submit_op(Op::RunUserShellCommand { + command: cmd.to_string(), + }); + return; + } + if !text.is_empty() { items.push(InputItem::Text { text: text.clone() }); } diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 7805e07e7b..98eaa8d7cb 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -525,6 +525,7 @@ fn begin_exec(chat: &mut ChatWidget, call_id: &str, raw_cmd: &str) { command, cwd: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")), parsed_cmd, + is_user_shell_command: false, }), }); } @@ -1039,6 +1040,7 @@ async fn binary_size_transcript_snapshot() { .into_iter() .map(std::convert::Into::into) .collect(), + is_user_shell_command: false, }), } } @@ -2026,6 +2028,7 @@ fn chatwidget_exec_and_status_layout_vt100_snapshot() { } .into(), ], + is_user_shell_command: false, }), }); chat.handle_codex_event(Event { diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index a63da9ead1..159f18286c 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -281,6 +281,7 @@ pub(crate) struct ExecCall { pub(crate) command: Vec, pub(crate) parsed: Vec, pub(crate) output: Option, + pub(crate) is_user_shell_command: bool, start_time: Option, duration: Option, } @@ -493,12 +494,19 @@ impl ExecCell { body_lines.extend(wrapped_borrowed.iter().map(|l| line_to_static(l))); } } + if let Some(output) = call.output.as_ref() - && output.exit_code != 0 + && (call.is_user_shell_command || output.exit_code != 0) { + let line_limit = if call.is_user_shell_command { + USER_SHELL_TOOL_CALL_MAX_LINES + } else { + TOOL_CALL_MAX_LINES + }; let out = output_lines( Some(output), OutputLinesParams { + line_limit, only_err: false, include_angle_pipe: false, include_prefix: false, @@ -590,11 +598,13 @@ impl ExecCell { call_id: String, command: Vec, parsed: Vec, + is_user_shell_command: bool, ) -> Option { let call = ExecCall { call_id, command, parsed, + is_user_shell_command, output: None, start_time: Some(Instant::now()), duration: None, @@ -638,6 +648,7 @@ impl HistoryCell for CompletedMcpToolCallWithImageOutput { const TOOL_CALL_MAX_LINES: usize = 5; const SESSION_HEADER_MAX_INNER_WIDTH: usize = 56; // Just an eyeballed value +const USER_SHELL_TOOL_CALL_MAX_LINES: usize = 50; fn card_inner_width(width: u16, max_inner_width: usize) -> Option { if width < 4 { @@ -793,11 +804,13 @@ pub(crate) fn new_active_exec_command( call_id: String, command: Vec, parsed: Vec, + is_user_shell_command: bool, ) -> ExecCell { ExecCell::new(ExecCall { call_id, command, parsed, + is_user_shell_command, output: None, start_time: Some(Instant::now()), duration: None, @@ -1590,6 +1603,7 @@ pub(crate) fn new_patch_apply_failure(stderr: String) -> PlainHistoryCell { formatted_output: String::new(), }), OutputLinesParams { + line_limit: TOOL_CALL_MAX_LINES, only_err: true, include_angle_pipe: true, include_prefix: true, @@ -1667,6 +1681,7 @@ pub(crate) fn new_reasoning_summary_block( } struct OutputLinesParams { + line_limit: usize, only_err: bool, include_angle_pipe: bool, include_prefix: bool, @@ -1674,6 +1689,7 @@ struct OutputLinesParams { fn output_lines(output: Option<&CommandOutput>, params: OutputLinesParams) -> Vec> { let OutputLinesParams { + line_limit, only_err, include_angle_pipe, include_prefix, @@ -1692,11 +1708,9 @@ fn output_lines(output: Option<&CommandOutput>, params: OutputLinesParams) -> Ve let src = if *exit_code == 0 { stdout } else { stderr }; let lines: Vec<&str> = src.lines().collect(); let total = lines.len(); - let limit = TOOL_CALL_MAX_LINES; - let mut out = Vec::new(); - let head_end = total.min(limit); + let head_end = total.min(line_limit); for (i, raw) in lines[..head_end].iter().enumerate() { let mut line = ansi_escape_line(raw); let prefix = if !include_prefix { @@ -1714,14 +1728,14 @@ fn output_lines(output: Option<&CommandOutput>, params: OutputLinesParams) -> Ve } // If we will ellipsize less than the limit, just show it. - let show_ellipsis = total > 2 * limit; + let show_ellipsis = total > 2 * line_limit; if show_ellipsis { - let omitted = total - 2 * limit; + let omitted = total - 2 * line_limit; out.push(format!("… +{omitted} lines").into()); } let tail_start = if show_ellipsis { - total - limit + total - line_limit } else { head_end }; @@ -2127,6 +2141,7 @@ mod tests { }, ], output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2158,6 +2173,7 @@ mod tests { cmd: "rg shimmer_spans".into(), }], output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2181,6 +2197,7 @@ mod tests { name: "shimmer.rs".into(), cmd: "cat shimmer.rs".into(), }], + false, ) .unwrap(); cell.complete_call( @@ -2202,6 +2219,7 @@ mod tests { name: "status_indicator_widget.rs".into(), cmd: "cat status_indicator_widget.rs".into(), }], + false, ) .unwrap(); cell.complete_call( @@ -2240,6 +2258,7 @@ mod tests { }, ], output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2268,6 +2287,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), cmd], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2298,6 +2318,7 @@ mod tests { command: vec!["echo".into(), "ok".into()], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2326,6 +2347,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), long], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2353,6 +2375,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), cmd], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2381,6 +2404,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), cmd], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2409,6 +2433,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), "seq 1 10 1>&2 && false".into()], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); @@ -2455,6 +2480,7 @@ mod tests { command: vec!["bash".into(), "-lc".into(), long_cmd.to_string()], parsed: Vec::new(), output: None, + is_user_shell_command: false, start_time: Some(Instant::now()), duration: None, }); diff --git a/codex-rs/tui/src/pager_overlay.rs b/codex-rs/tui/src/pager_overlay.rs index b92939a1a5..60bb3a8bd3 100644 --- a/codex-rs/tui/src/pager_overlay.rs +++ b/codex-rs/tui/src/pager_overlay.rs @@ -691,6 +691,7 @@ mod tests { "exec-1".into(), vec!["bash".into(), "-lc".into(), "ls".into()], vec![ParsedCommand::Unknown { cmd: "ls".into() }], + false, ); exec_cell.complete_call( "exec-1",