[FEATURE] Add /restart command #6618

Open
opened 2026-02-16 18:04:47 -05:00 by yindo · 5 comments
Owner

Originally created by @JosXa on GitHub (Jan 17, 2026).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @JosXa on GitHub (Jan 17, 2026). Originally assigned to: @thdxr on GitHub. ## 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.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 17, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6815: Add command palette action to reload configuration without restart
  • #8751: Hot-reload agents, skills and commands
  • #6719: slash command for reload
  • #7701: Reload auth.json if changed

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 17, 2026): This issue might be a duplicate of existing issues. Please check: - #6815: Add command palette action to reload configuration without restart - #8751: Hot-reload agents, skills and commands - #6719: slash command for reload - #7701: Reload auth.json if changed Feel free to ignore if none of these address your specific case.
Author
Owner

@ariane-emory commented on GitHub (Jan 18, 2026):

If the command is going to behave as if --continue had been passed (which I am not sure if I would agree with to begin with), then I think that /reload would be a more appropriate command name than /restart.

@ariane-emory commented on GitHub (Jan 18, 2026): If the command is going to behave as if `--continue` had been passed (which I am not sure if I would agree with to begin with), then I think that `/reload` would be a more appropriate command name than `/restart`.
Author
Owner

@JosXa commented on GitHub (Jan 18, 2026):

If the command is going to behave as if --continue had been passed (which I am not sure if I would agree with to begin with), then I think that /reload would be a more appropriate command name than /restart.

Yeah, it's ultimately what I want, but this is more of a workaround to get an actual /reload command from #6719! Thus /restart. Do you disagree?

If anyone can give me pointers on how to implement this ticket using a Plugin, I'm all ears!

@JosXa commented on GitHub (Jan 18, 2026): > If the command is going to behave as if `--continue` had been passed (which I am not sure if I would agree with to begin with), then I think that `/reload` would be a more appropriate command name than `/restart`. Yeah, it's ultimately what I want, but this is more of a workaround to get an _actual_ /reload command from #6719! Thus /restart. Do you disagree? If anyone can give me pointers on how to implement this ticket using a Plugin, I'm all ears!
Author
Owner

@ariane-emory commented on GitHub (Jan 18, 2026):

I just think that /reload would be a more apt name if it isn't going to result in a return to the startup screen. Since #6719 hasn't actually been resolved yet, if a /reload is indeed actually what you'd prefer, then any solution that resolves one would simultaneously resolve the other. Do you agree with this assessment? I could, of course, be overlooking something I just woke an hour ago and haven't had any caffeine yet.

@ariane-emory commented on GitHub (Jan 18, 2026): I just think that `/reload` would be a more apt name if it isn't going to result in a return to the startup screen. Since #6719 hasn't actually been resolved yet, if a `/reload` is indeed actually what you'd prefer, then any solution that resolves one would simultaneously resolve the other. Do you agree with this assessment? I could, of course, be overlooking something I just woke an hour ago and haven't had any caffeine yet.
Author
Owner

@JosXa commented on GitHub (Jan 18, 2026):

I could, of course, be overlooking something I just woke an hour ago and haven't had any caffeine yet.

I know the feeling ⚰️

Yeah, let me see. I suppose time would be better spent in the other ticket. I just figured that this one would maybe be easier to get going - but may aswell be wrong. I just ran an analysis on the codebase and posted it below:
https://github.com/anomalyco/opencode/issues/6719#issuecomment-3765604023

OC thinks it's not too hard.

@JosXa commented on GitHub (Jan 18, 2026): > I could, of course, be overlooking something I just woke an hour ago and haven't had any caffeine yet. I know the feeling ☕⚰️ Yeah, let me see. I suppose time would be better spent in the other ticket. I just figured that this one would maybe be easier to get going - but may aswell be wrong. I just ran an analysis on the codebase and posted it below: https://github.com/anomalyco/opencode/issues/6719#issuecomment-3765604023 OC thinks it's not too hard.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6618