fix bash commands being incorrectly quoted in display (#2313)

The "display format" of commands was sometimes producing incorrect
quoting like `echo foo '>' bar`, which is importantly different from the
actual command that was being run. This refactors ParsedCommand to have
a string in `cmd` instead of a vec, as a `vec` can't accurately capture
a full command.
This commit is contained in:
Jeremy Rose
2025-08-14 17:08:29 -04:00
committed by GitHub
parent 20cd61e2a4
commit 7038827bf4
3 changed files with 289 additions and 290 deletions

View File

@@ -206,7 +206,7 @@ fn exec_history_cell_shows_working_then_completed() {
command: vec!["bash".into(), "-lc".into(), "echo done".into()],
cwd: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
parsed_cmd: vec![codex_core::parse_command::ParsedCommand::Unknown {
cmd: vec!["echo".into(), "done".into()],
cmd: "echo done".into(),
}],
}),
});
@@ -248,7 +248,7 @@ fn exec_history_cell_shows_working_then_failed() {
command: vec!["bash".into(), "-lc".into(), "false".into()],
cwd: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
parsed_cmd: vec![codex_core::parse_command::ParsedCommand::Unknown {
cmd: vec!["false".into()],
cmd: "false".into(),
}],
}),
});