Standalone installer ignores ZDOTDIR and leaves codex off PATH in new Zsh sessions

Open Beginner friendly
#61,439 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell, zsh

Research direction

The profile selection logic is in scripts/install/install.sh around lines 576-593, where the installer picks the Zsh startup file it appends PATH to. Start there and change the choice to honor ZDOTDIR before falling back to HOME. Done means the reproduction in the issue prints the custom ZDOTDIR marker and finds codex in a fresh interactive zsh -ic session.

Written by the indexing model from the issue text.

Description

bug CLI

With an exported ZDOTDIR, a successful standalone install adds its PATH block to ~/.zshrc. Linux Zsh reads $ZDOTDIR/.zshrc instead. The installer's instruction to open a new terminal and run codex then fails.

Steps to reproduce On Linux with Zsh, start in the Codex checkout. This uses a disposable home and starts with the installation directory off PATH.

installer="$PWD/scripts/install/install.sh"
d=$(mktemp -d)
mkdir -p "$d/home/.config/zsh"
printf 'export CUSTOM_ZSHRC_LOADED=yes\n' > "$d/home/.config/zsh/.zshrc"
env HOME="$d/home" ZDOTDIR="$d/home/.config/zsh" PATH=/usr/bin:/bin \
  SHELL=/bin/zsh CODEX_HOME="$d/codex-home" CODEX_INSTALL_DIR="$d/bin" \
  CODEX_NON_INTERACTIVE=1 sh "$installer"
env HOME="$d/home" ZDOTDIR="$d/home/.config/zsh" PATH=/usr/bin:/bin \
  /bin/zsh -ic 'echo "$CUSTOM_ZSHRC_LOADED"; command -v codex || echo missing'
test -x "$d/bin/codex"

Observed On Linux x86_64 with Zsh 5.9, the checkout's offline release fixture ran the installer at de83e7674a69b9ae18544dd1fbf53f31bfe8c640 to completion. It reported adding PATH to $HOME/.zshrc. A fresh interactive Zsh printed yes and missing, even though the installed executable existed.

Expected A new Zsh session that reads the user's configured startup directory should find the installed CLI.

Suggested fix Use ${ZDOTDIR:-$HOME} when choosing the Zsh startup file. Exercise the startup-file selection with a real interactive Zsh and an exported nondefault ZDOTDIR. Profile selection

Dominant language
Rust
Stars
135k
Forks
21.4k
Avg merge
1m
Merged PRs (30d)
997

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.