codex CLI fails to start in non-tty (Jupyter notebook) environments due to raw-mode requirement
Resolved 💬 2 comments Opened Jun 3, 2025 by zazula Closed Oct 16, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
Summary
When launching codex CLI in a Jupyter notebook (or other non-tty environments), it fails to start with the following error:
ERROR Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on
https://github.com/vadimdemedes/ink/#israwmodesupported
Steps to reproduce
- Open a Jupyter notebook environment.
- Run
!codex --session-mode new --skip-ask-mode.
Expected Behavior
Codex CLI should detect the absence of a tty and either:
- fallback to a plain text mode
- or provide instructions to disable raw mode or use a flag.
Actual Behavior
Codex CLI immediately errors out and does not provide a usable fallback.
Environment
- codex version: 0.0.0-dev
- Node.js version: v24.1.0
- Jupyter notebook
- Platform: $(uname -a)
Suggested Fix
Consider detecting non-tty stdin and:
- Automatically disable Ink's raw-mode and degrade to a plain logging mode.
- Or provide a
--no-ttyflag to disable raw-mode.
2 Comments
⚠️ Same underlying issue in #1080, #1156, and #1208 (also reproducible in AWS Lambda)
All three reports crash with the identical Ink error:
Error: Raw mode is not supported on the current process.stdin …The Codex CLI calls stdin.setRawMode(true) via Ink’s useInput.
If the process has no real TTY (CI runners, Jupyter/Colab, Lambda, Docker without -t) Ink throws and Codex exits before any flags are parsed.
➡️ There is no reliable headless work-around yet
• Setting CI=true and passing --yes --allow-outside-git --approval-mode full-auto is not sufficient—Ink still initialises useInput and the CLI crashes.
• Same result in Lambda, GitHub Actions, Azure Functions, and Colab notebooks.
🛠 Proposed fix for the CLI
Until then the only viable option is:
Run Codex CLI inside an environment that has a TTY (e.g. self-hosted runner with docker run -it …).
Closing as obsolete since the migration to codex-rs