TUI should treat bare exit and quit as exit commands
What version of Codex CLI is running?
codex-cli 0.139.0
What subscription do you have?
ChatGPT plan (not relevant to this local TUI input behavior)
Which model were you using?
Not model-specific.
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
iTerm2 3.5.14
Codex doctor report
codex doctor --json is available. The report shows the install/runtime are locally consistent, but network reachability checks fail in this sandboxed environment, which is unrelated to this local composer behavior.
What issue are you seeing?
In the TUI composer, typing exit or quit and pressing Enter submits that word as a normal prompt instead of exiting the session.
This is surprising because /exit is the explicit slash command for the same action, and a bare exit/quit is a common shell-style exit affordance. The result is that users can accidentally send exit to the model when they intended to leave the TUI.
What steps can reproduce the bug?
- Open Codex CLI in TUI mode.
- Type
exitinto the composer. - Press Enter.
The same behavior occurs with quit.
What is the expected behavior?
When slash commands are enabled in the full TUI composer, a bare exit or quit draft should dispatch the existing /exit command.
Whitespace-prefixed values such as exit should still submit as literal text, matching the existing slash-command opt-out behavior. Reusable plain text composer widgets should also be able to keep exit and quit as normal text.
Additional information
This should not affect paste handling: a terminal paste whose first line is exit should continue to be treated as pasted text rather than closing the session.
2 Comments
I prepared a focused fix branch for this issue, but GitHub rejected PR creation from this account with:
Branch: https://github.com/icankeep/codex/tree/fix/bare-exit-command
Commit: https://github.com/icankeep/codex/commit/cabc06f
Local validation:
PATH="$HOME/.cargo/bin:$PATH" just fmtgit diff --checkPATH="$HOME/.cargo/bin:$PATH" just test -p codex-tuiis blocked locally before tests run by a reproducible rustc 1.95.0 ICE while compilingwebrtc-sys(range end index 84237728 out of range for slice of length 84078676).Prompts that start with a slash are interpreted by the client.
/quitand/exitare examples of such slash commands. Prompts that do not start with a slash are sent to the model and interpreted as normal agent prompts.