codex - 💡(How to fix) Fix feat: treat bare `exit` and `quit` as aliases for `/exit` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20247Fetched 2026-04-30 06:31:10
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3closed ×1commented ×1

Fix Action

Fix / Workaround

In chat_composer.rs, add a try_dispatch_plain_exit_aliases method that checks whether the entire composer input (trimmed) is exactly "exit" or "quit", and if so, dispatches SlashCommand::Exit with the same side-effects as try_dispatch_bare_slash_command. Guarded by slash_commands_enabled() and !is_bash_mode (so typing exit in bash mode still passes through as a shell command).

RAW_BUFFERClick to expand / collapse

What

Make it so typing exit or quit (without the leading /) and pressing Enter in the Codex TUI chat composer behaves identically to /exit or /quit.

Why

Users coming from shell or REPL environments instinctively type exit to quit. The current behavior silently submits it as a chat message instead, which is surprising. The fix is a small quality-of-life improvement that aligns Codex with the mental model most CLI users carry.

Proposed approach

In chat_composer.rs, add a try_dispatch_plain_exit_aliases method that checks whether the entire composer input (trimmed) is exactly "exit" or "quit", and if so, dispatches SlashCommand::Exit with the same side-effects as try_dispatch_bare_slash_command. Guarded by slash_commands_enabled() and !is_bash_mode (so typing exit in bash mode still passes through as a shell command).

I have a working implementation with two new tests (plain_exit_requests_exit, plain_quit_requests_exit) that pass alongside the existing slash_commands test suite. Happy to submit a PR if invited.

extent analysis

TL;DR

Implement a try_dispatch_plain_exit_aliases method in chat_composer.rs to handle "exit" or "quit" inputs without a leading slash.

Guidance

  • Check the chat_composer.rs file for the proposed try_dispatch_plain_exit_aliases method implementation.
  • Verify that the method correctly dispatches SlashCommand::Exit when the input is exactly "exit" or "quit" (trimmed).
  • Ensure the fix is guarded by slash_commands_enabled() and !is_bash_mode to maintain existing behavior in bash mode.
  • Review the new tests (plain_exit_requests_exit, plain_quit_requests_exit) to confirm they cover the desired functionality.

Example

No code snippet is provided as the issue already mentions a working implementation.

Notes

This fix assumes that the try_dispatch_bare_slash_command method is correctly implemented and has the desired side-effects for the /exit and /quit commands.

Recommendation

Apply the proposed workaround by implementing the try_dispatch_plain_exit_aliases method, as it provides a small quality-of-life improvement for users familiar with shell or REPL environments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix feat: treat bare `exit` and `quit` as aliases for `/exit` [1 comments, 2 participants]