opencode
opencode copied to clipboard
Add /exit as alias for /quit
Summary
- Add comprehensive slash command support to TUI editor input
- Fix critical issue where
/quitcommand wasn't working due to completion dialog interference - Implement exact command matching logic to bypass completion dialog for direct commands
Problem Fixed
The /quit command wasn't working because typing / triggered a completion dialog that intercepted the Enter key before the command could be executed directly. Users were unable to quit the application using /quit, which is a critical usability issue.
Solution
- Enhanced editor: Added slash command parsing and execution logic to handle commands like
/quit,/exit,/help - Fixed completion dialog: Added exact command matching to bypass completion dialog when user types exact command triggers
- Maintained compatibility: Partial commands still trigger completion dialog, preserving existing UX for command discovery
Test Coverage
- Comprehensive tests for slash command parsing and execution
- Tests for exact vs partial command matching behavior
- Tests for completion dialog bypass logic
- Tests for all quit command triggers (
quit,exit,q)
🤖 Generated with opencode
if you want to resolve conflicts i'll get this merged @rmoriz
@adamdotdevin I've rebased and manually checked the PR. I've discovered the real issue which was caused by the completion handling of the TUI. Exact matches followed by ENTER would not be recognized.
so, /exit already is an alias for /quit, and i recently fixed an issue around selecting current item on space (rather than closing); is there anything left here?
Does /quit work in the current release version?
If not, this patch is still relevant.