Skip to content

feat: treat bare exit and quit as aliases for /exit #20247

@callmemorgan

Description

@callmemorgan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions