Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shell): Windows PATH probe reads User and Machine registry #37632

Mergeddieterstemmet(GitHub profile, opens in a new tab)merged 10 commits intomain fromrefs/pull/37632/headmerged by juliusmarminge View on GitHub

Showing 12 changed files with 24 additions and 2 deletions (loading 9).

x
0 of 12 viewed, 12 left
2 additions and 1 deletionapps/desktop/src/shell/DesktopShellEnvironment.tsModified
View file
@@ -6,6 +6,7 @@
mergePathValues,
readUserLoginShell,
setWindowsPath,
+ windowsEnvironmentValueCommand,
} from "@t3tools/shared/shell";
import * as Context from "effect/Context";
import * as Duration from "effect/Duration";
@@ -232,7 +233,7 @@
...names.flatMap((name) => {
return [
`Write-Output '${startMarker(name)}'`,
- `$value = [Environment]::GetEnvironmentVariable('${name}')`,
+ windowsEnvironmentValueCommand(name),
"if ($null -ne $value -and $value.Length -gt 0) { Write-Output $value }",
`Write-Output '${endMarker(name)}'`,
5 additions and 1 deletionapps/server/src/policy/ManagedPolicy.test.tsModified
View file
@@ -193,7 +193,11 @@
]);
// The host variable that replaces Codex's launch arguments is ignored too.
const host = { PATH: "/usr/bin", T3CODE_CODEX_LAUNCH_ARGS: "-c mcp_servers.x.command=sh" };
- assert.deepEqual(providerHostEnvironment(policy.summary, host), { PATH: "/usr/bin" });
+ const managedHost = providerHostEnvironment(policy.summary, host);
+ assert.deepEqual(managedHost, { PATH: "/usr/bin" });
+ // A PATH refresh after launch reaches drivers that hold the managed copy.