PTY spawn fails when arg0 override is provided

Resolved 💬 0 comments Opened Nov 21, 2025 by weillercarvalho Closed Nov 26, 2025

What version of Codex is running?

codex-cli 0.61.0

What subscription do you have?

plus

Which model were you using?

gpt-5.1-codex-max (default)

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

Setting an arg0 override for PTY commands makes Codex try to exec the override string as the program, so the PTY spawn fails (e.g., No such file or directory when arg0 is custom-argv0) and commands never start.

What steps can reproduce the bug?

  1. Invoke a PTY-based exec with program=/bin/sh, args like ["-c", "echo hi"], and arg0=Some("custom-argv0").
  2. portable-pty builds the command using arg0 as the executable; the process fails to start.

What is the expected behavior?

The PTY should execute the real program (/bin/sh), treat the arg0 override only as argv[0], and run the command normally (e.g., outputs “hi” with exit code 0).

Additional information

_No response_

View original on GitHub ↗