TUI should treat bare exit and quit as exit commands

Resolved 💬 2 comments Opened Jun 12, 2026 by icankeep Closed Jun 16, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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?

  1. Open Codex CLI in TUI mode.
  2. Type exit into the composer.
  3. 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.

View original on GitHub ↗

2 Comments

icankeep · 2 months ago

I prepared a focused fix branch for this issue, but GitHub rejected PR creation from this account with:

GraphQL: icankeep does not have the correct permissions to execute `CreatePullRequest`

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 fmt
  • git diff --check
  • PATH="$HOME/.cargo/bin:$PATH" just test -p codex-tui is blocked locally before tests run by a reproducible rustc 1.95.0 ICE while compiling webrtc-sys (range end index 84237728 out of range for slice of length 84078676).
etraut-openai contributor · 2 months ago

Prompts that start with a slash are interpreted by the client. /quit and /exit are examples of such slash commands. Prompts that do not start with a slash are sent to the model and interpreted as normal agent prompts.