Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions codex-rs/core/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ impl Shell {
]
}
ShellType::PowerShell => {
let mut args = vec![self.shell_path.to_string_lossy().to_string()];
let mut args = vec![
self.shell_path.to_string_lossy().to_string(),
"-NoLogo".to_string(),
];
if !use_login_shell {
args.push("-NoProfile".to_string());
}
Expand Down Expand Up @@ -442,11 +445,17 @@ mod tests {
};
assert_eq!(
test_powershell_shell.derive_exec_args("echo hello", false),
vec!["pwsh.exe", "-NoProfile", "-Command", "echo hello"]
vec![
"pwsh.exe",
"-NoLogo",
"-NoProfile",
"-Command",
"echo hello"
]
);
assert_eq!(
test_powershell_shell.derive_exec_args("echo hello", true),
vec!["pwsh.exe", "-Command", "echo hello"]
vec!["pwsh.exe", "-NoLogo", "-Command", "echo hello"]
);
}

Expand Down
7 changes: 4 additions & 3 deletions codex-rs/core/src/tools/handlers/unified_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ mod tests {

let command = get_command(&args);

assert_eq!(command.len(), 3);
assert_eq!(command[2], "echo hello");
let expected_command_len = if cfg!(windows) { 4 } else { 3 };
assert_eq!(command.len(), expected_command_len);
assert_eq!(command.last().unwrap(), "echo hello");
}

#[test]
Expand Down Expand Up @@ -338,7 +339,7 @@ mod tests {

let command = get_command(&args);

assert_eq!(command[2], "echo hello");
assert_eq!(command.last().unwrap(), "echo hello");
}

#[test]
Expand Down
Loading