opencode
opencode copied to clipboard
[FEATURE] Add /restart command
Feature Request
Problem
Currently, when wanting to restart OpenCode (e.g., to reload configuration), users need to:
- Execute
/exitto quit OpenCode - Manually start OpenCode again
This two-step process is cumbersome and interrupts the workflow. It is very slow too, around 4-5 seconds for me, and you need to baby-sit it to wait for it to exit cleanly.
Note also that on Windows, we still cannot spam Ctrl+C to quit, as that will cause Bun to print strange control characters into the console without exiting properly.
Proposed Solution
Add a /restart command that:
- Restarts the OpenCode session in a single command
- Thus reloads configuration automatically
- Maintains the current working directory (maybe even with
--continueflag)
Benefits
- Improved user experience and workflow efficiency when making config changes
- Easier configuration reloading (until automatic #6719 implemented)
- Reduces friction when making configuration changes
Use Case
This would be particularly useful when users modify their OpenCode configuration and want to apply changes without the manual exit/restart cycle.