mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
fix: command formatting for user commands (#7002)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests.rs
|
||||
expression: blob
|
||||
---
|
||||
• You ran ls
|
||||
└ file1
|
||||
file2
|
||||
@@ -1790,6 +1790,28 @@ fn exec_history_extends_previous_when_consecutive() {
|
||||
assert_snapshot!("exploring_step6_finish_cat_bar", active_blob(&chat));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn user_shell_command_renders_output_not_exploring() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
|
||||
|
||||
let begin_ls = begin_exec_with_source(
|
||||
&mut chat,
|
||||
"user-shell-ls",
|
||||
"ls",
|
||||
ExecCommandSource::UserShell,
|
||||
);
|
||||
end_exec(&mut chat, begin_ls, "file1\nfile2\n", "", 0);
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
assert_eq!(
|
||||
cells.len(),
|
||||
1,
|
||||
"expected a single history cell for the user command"
|
||||
);
|
||||
let blob = lines_to_single_string(cells.first().unwrap());
|
||||
assert_snapshot!("user_shell_ls_output", blob);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn disabled_slash_command_while_task_running_snapshot() {
|
||||
// Build a chat widget and simulate an active task
|
||||
|
||||
@@ -117,7 +117,8 @@ impl ExecCell {
|
||||
}
|
||||
|
||||
pub(super) fn is_exploring_call(call: &ExecCall) -> bool {
|
||||
!call.parsed.is_empty()
|
||||
!matches!(call.source, ExecCommandSource::UserShell)
|
||||
&& !call.parsed.is_empty()
|
||||
&& call.parsed.iter().all(|p| {
|
||||
matches!(
|
||||
p,
|
||||
|
||||
Reference in New Issue
Block a user