expand the set of core shell env vars for Windows. (#20089)

https://github.com/openai/codex/issues/13917 and
https://github.com/openai/codex/issues/18248 correctly identify that

```
[shell_environment_policy]
inherit = "core"
```
is not functional on Windows because it carries an insufficient set of
env vars.
This PR expands that to match the more functional set from the MCP
client
This commit is contained in:
iceweasel-oai authored and GitHub committed 2026-04-29 19:23:46 +00:00
1 parent 07c8b8c77c
commit 9d1e5df4b2
2 files changed
+149 -48

No files matched your search

+2 -29
View File
@@ -142,35 +142,8 @@ pub(crate) const DEFAULT_ENV_VARS: &[&str] = &[
];
#[cfg(windows)]
pub(crate) const DEFAULT_ENV_VARS: &[&str] = &[
// Core path resolution
"PATH",
"PATHEXT",
// Shell and system roots
"COMSPEC",
"SYSTEMROOT",
"SYSTEMDRIVE",
// User context and profiles
"USERNAME",
"USERDOMAIN",
"USERPROFILE",
"HOMEDRIVE",
"HOMEPATH",
// Program locations
"PROGRAMFILES",
"PROGRAMFILES(X86)",
"PROGRAMW6432",
"PROGRAMDATA",
// App data and caches
"LOCALAPPDATA",
"APPDATA",
// Temp locations
"TEMP",
"TMP",
// Common shells/pwsh hints
"POWERSHELL",
"PWSH",
];
pub(crate) const DEFAULT_ENV_VARS: &[&str] =
codex_protocol::shell_environment::WINDOWS_CORE_ENV_VARS;
#[cfg(test)]
mod tests {