Skip to content

[FEATURE] Add /restart command #9113

Closed
Closed

Description

@JosXa

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 [FEATURE]: slash command for reload #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.

Activity

  1. github-actions commented on Jan 17, 2026

    @github-actions
    Contributor

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

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

  2. changed the title [-]Feature Request: Add /restart command[/-] [+][FEATURE] Add /restart command[/+] on Jan 17, 2026
  3. ariane-emory commented on Jan 18, 2026

    @ariane-emory
    Contributor

    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.

  4. added a commit that references this issue on Jan 18, 2026
    59580b6
  5. JosXa commented on Jan 18, 2026

    @JosXa
    ContributorAuthor

    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!

  6. ariane-emory commented on Jan 18, 2026

    @ariane-emory
    Contributor

    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.

  7. JosXa commented on Jan 18, 2026

    @JosXa
    ContributorAuthor

    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:
    #6719 (comment)

    OC thinks it's not too hard.

  8. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions