Skip to content

feat: support "exit" as a keyword to quit the session#2152

Merged
trungutt merged 2 commits intodocker:mainfrom
trungutt:support-exit-keyword
Mar 18, 2026
Merged

feat: support "exit" as a keyword to quit the session#2152
trungutt merged 2 commits intodocker:mainfrom
trungutt:support-exit-keyword

Conversation

@trungutt
Copy link
Copy Markdown
Contributor

@trungutt trungutt commented Mar 18, 2026

Summary

  • Typing exit, quit, or :q in the TUI now terminates the session immediately, equivalent to the /exit slash command.
  • Added /quit and /q as slash command aliases for /exit.
  • The bare keyword check is case-sensitive and whitespace-trimmed, matching opencode's behavior.
  • Works even when the agent is busy (the check runs before queue logic in handleSendMsg).

Typing "exit" in the TUI now terminates the session immediately,
equivalent to the /exit slash command. The check is case-insensitive
and whitespace-trimmed, and runs before slash command parsing so it
works even when the agent is busy.
Add "quit" and ":q" as bare keywords (alongside "exit") that quit the
session immediately. Also register /quit and /q as slash command aliases
for /exit. The bare keyword check is now case-sensitive, matching
opencode's implementation.
@trungutt trungutt marked this pull request as ready for review March 18, 2026 08:33
@trungutt trungutt requested a review from a team as a code owner March 18, 2026 08:33
Copy link
Copy Markdown

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

This PR cleanly implements support for bare keywords (exit, quit, :q) and slash command aliases (/quit, /q) to quit the session. The implementation is straightforward and consistent with existing slash command behavior.

Review Summary:

  • ✅ Bare keywords execute immediately, bypassing queue logic (as intended)
  • ✅ Case-sensitive matching is consistent with slash command behavior
  • ✅ Both bare keywords and slash commands work even when agent is busy
  • ✅ No bugs found in the changed code

The code correctly implements the stated requirements and follows the project's existing patterns.

@trungutt trungutt merged commit 0f2fc76 into docker:main Mar 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants