opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE] Add /restart command

Open JosXa opened this issue 1 day ago • 5 comments

Feature Request

Problem

Currently, when wanting to restart OpenCode (e.g., to reload configuration), users need to:

  1. Execute /exit to quit OpenCode
  2. 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 --continue flag)

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.

JosXa avatar Jan 17 '26 18:01 JosXa