Skip to content

Commit 74e2747

Browse files
fix(windows): follow active Codex home for tray listener
1 parent 7cb15bf commit 74e2747

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/tray/windows.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { execFile, execFileSync, spawn } from "node:child_process";
22
import { createHash } from "node:crypto";
33
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
4-
import { homedir } from "node:os";
54
import { join, resolve } from "node:path";
6-
import { expandUserPath, getConfigDir } from "../config";
5+
import { getConfigDir } from "../config";
76
import { durableBunPath } from "../lib/bun-runtime";
87
import { hardenSecretDir, hardenSecretPath } from "../lib/windows-secret-acl";
8+
import { resolveCodexHomeDir } from "../codex/home";
99

1010
const RUN_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";
1111
const RUN_PARENT_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion";
@@ -75,8 +75,10 @@ function sourceTrayIconPaths(): string[] {
7575
}
7676

7777
function currentCodexHome(): string {
78-
const raw = process.env.CODEX_HOME?.trim();
79-
return raw ? resolve(expandUserPath(raw)) : join(homedir(), ".codex");
78+
// Keep the tray's listener/launcher target aligned with Codex's active home.
79+
// This matters on the Windows desktop setup, where CODEX_HOME is E:\\codex
80+
// instead of the historical %USERPROFILE%\\.codex fallback.
81+
return resolveCodexHomeDir();
8082
}
8183

8284
function currentEntry(): WindowsTrayEntry {

0 commit comments

Comments
 (0)