Preserve WINDIR in core Windows shell environments (#39809)

## What changed

- Add `WINDIR` to the Windows core environment variable allowlist.
- Extend the Windows core-inheritance test to verify that a case-variant
  `WinDir` entry is retained.

GitOrigin-RevId: 0305d8fa882ba2705a7ce7661098cedac1339c43
This commit is contained in:
zm-oai
2026-08-20 23:14:32 +00:00
committed by copyberry
parent 2790c13899
commit 3cde5d4ccd
@@ -172,6 +172,7 @@ pub const WINDOWS_CORE_ENV_VARS: &[&str] = &[
"SHELL",
"COMSPEC",
"SYSTEMROOT",
"WINDIR",
"SYSTEMDRIVE",
// User context and profiles
"USERNAME",
@@ -218,6 +219,7 @@ mod windows_tests {
let vars = make_vars(&[
("Shell", "C:\\Program Files\\Git\\bin\\bash.exe"),
("SystemRoot", "C:\\Windows"),
("WinDir", "C:\\Windows"),
("AppData", "C:\\Users\\codex\\AppData\\Roaming"),
("TmpDir", "C:\\Temp\\custom"),
("OPENAI_API_KEY", "secret"),
@@ -237,6 +239,7 @@ mod windows_tests {
"C:\\Program Files\\Git\\bin\\bash.exe".to_string(),
),
("SystemRoot".to_string(), "C:\\Windows".to_string()),
("WinDir".to_string(), "C:\\Windows".to_string()),
(
"AppData".to_string(),
"C:\\Users\\codex\\AppData\\Roaming".to_string(),