Repository navigation
fix(desktop): match T3CODE_HOME and WSLENV case-insensitively on Windows - #36114
helmipradita wants to merge 1 commit into
Conversation
Windows environment variables are case-insensitive. A lowercase or mixed-case 't3code_home' previously bypassed the filter and leaked host paths into the WSL backend environment, while 'wslenv' was dropped when forwarding inherited entries and created colliding cased keys. Case-fold the comparison so host T3 home paths are always stripped and inherited WSLENV values are preserved regardless of case. Fixes pingdotgg#35961, fixes pingdotgg#35957 Signed-off-by: Helmi Pradita <helmipraditaa@gmail.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This normalizes Windows environment-key handling for WSL startup, preserving forwarding settings and preventing mixed-case T3CODE_HOME from crossing into Linux. The change is narrowly confined to child-process configuration and preserves existing isolation intent. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
All 8 required checks are green on |
Problem
Windows environment variables are case-insensitive. In
DesktopBackendConfiguration.ts:t3code_homeescaped thekey === "T3CODE_HOME"filter and leaked the Windows host home into the WSL backend child environment ([Bug]: Lowercase Windows T3CODE_HOME survives the WSL backend isolation filter #35961).wslenvwas not found atparentEnvWithoutT3Home.WSLENV, dropping user-inherited entries and creating colliding duplicate keys ({ wslenv, WSLENV }) when forwarded ([Bug]: WSL launch drops inherited entries when the Windows environment key is spelled wslenv #35957).Change
Case-fold the key comparison against
"T3CODE_HOME"and"WSLENV"when preparing the WSL launch environment, ensuring host T3 home paths are always stripped and inheritedWSLENVvalues are merged and forwarded into canonical uppercaseWSLENV.Scope
Fixes #35961
Fixes #35957
Verification
resolveWsl strips lowercase t3code_home and forwards lowercase wslenv on Windowsunit test inapps/desktop/src/backend/DesktopBackendConfiguration.test.tsverifying thatt3code_homeandwslenvare stripped from the parent env, while inherited entries are preserved inconfig.env.WSLENV.