Skip to content

Desktop: option to minimize to tray / keep running when window is closed #42349

Closed as not planned

Description

@DobeShadow

Summary

On Windows, clicking the window close button (x) quits the OpenCode desktop app entirely. When the last window is closed, window-all-closed calls app.quit() (see packages/desktop/src/main/index.ts).

I would like an option so that closing the window minimizes to the system tray / keeps the app running in the background instead of quitting, similar to apps like Slack or Discord. This is useful because ongoing agent runs (long tool calls, background tasks) keep executing, and I don't want to lose them just by clicking the window close button.

Feature request

  • Add a setting (e.g. in Settings, or a close_to_tray / minimize_on_close config) that makes the x button hide the window instead of quitting the app.
  • Show a tray icon (currently there is no Tray usage in the desktop main process) so the app can be restored from the tray.
  • On macOS the existing window-all-closed behavior (app stays running) could stay as-is; this is mainly for Windows/Linux.

Additional context

  • Desktop app version: ai.opencode.desktop (Electron-based), package packages/desktop
  • Current behavior source: packages/desktop/src/main/index.ts -> app.on("window-all-closed", () => { if (process.platform === "darwin") return; app.quit() })
  • No tray or BrowserWindow.hide() usage exists today.

Thanks for considering!

Activity

  1. github-actions commented on Aug 13, 2026

    @github-actions
    Contributor

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

    If your request adds meaningfully different context, please clarify how it differs from #27463.

  2. github-actions commented on Oct 14, 2026

    @github-actions
    Contributor

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

  3. AL-Mint commented on Oct 29, 2026

    @AL-Mint

    Still relevant on the current release - could this be reopened?

    Verified against OpenCode Desktop 2.2.0 on Windows 11 (Windows_NT 10.0.26200, x64). The behavior described in this issue is unchanged:

    • The app is Electron-based, but the main process never creates an Electron Tray instance, so there is no tray icon at all.
    • The minimize button only shrinks the window to the taskbar; there is no tray fallback.
    • Closing the last window quits the app (window-all-closed -> app.quit() on non-macOS platforms), which kills any in-flight agent run.

    Requested behavior is unchanged from the original report:

    1. A tray icon with an Open / Quit menu, so the app can be hidden instead of terminated.
    2. A setting for the close button: minimize to tray (default off) vs. quit.
    3. Keep the background service / agent runs alive while the window is hidden.

    Current workaround on Windows: third-party tray tools (Traymond, RBTray, Trayconizer) intercept the minimize button, since the app exposes no hook of its own.

    There are a few near-duplicates of this request (#27463, #18134, #35775) - ideally they could be merged into this one. If a fresh issue is preferred instead, happy to file one.

  4. Hona commented on Oct 29, 2026

    @Hona
    Member

    We can consider this.

    Just note even though the UI does fully close - your agents are still running in the persistent OpenCode server!

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