GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Desktop: add "Open in new window" to the tab context menu · Issue #58985 · anomalyco/opencode

Desktop: add "Open in new window" to the tab context menu #58985

New issue
Copy link
New issue
Copy link
Open
Open
Desktop: add "Open in new window" to the tab context menu#58985
Copy link

Description

@visualzbyvj
visualzbyvj
opened on Oct 25, 2026
Issue body actions

Summary

There is no way to take a session you already have open in a tab and move it into its own window. Ctrl+Shift+N (File > New Window) gives you an empty window on Home, and you then have to find that same session again and re-open it. The tab context menu offers only "Rename" and "Close tab".

Right-click a tab → Open in new window would do it in one action, and the tab menu is already being extended (see #56114), so this is an addition to an established surface rather than a new one.

Search first, so this is not a duplicate

The following return zero results in this repo: "detach tab", "tear off". No issue title or body asks to move a session tab into a separate window. The related items below are cited because they establish the existing machinery this feature would use, not because they are the same request.

  • New Window shortcut (Ctrl+Shift+N) does nothing on Windows desktop #41592 — proves File → New Window works from the menu today (only the Windows accelerator was unwired). This issue is not asking for multi-window support; it asks to route an existing tab into one.
  • [Bug]: Desktop auto-update discards window tab layout (new window ID, old window state orphaned) #46938 — documents that tab layout is persisted per window UUID (opencode.window.<uuid>.dat, holding tabs, tabs.recent, tabs.info, tabs.closed, keyed from windowIds in settings). Detaching a tab is moving one entry between two of those records, which is the state model this feature has to respect.
  • [Bug][Desktop v2] Middle-clicking a subagent opens a separate Not Found window #38949 — an "open this session as a separate window" path is already reachable from session context and lands on Not Found for child sessions. This is evidence the path exists and is incomplete, rather than absent.
  • desktop: per-window permission handler on a shared Electron session gets overwritten #51748 — open; per-window state on the shared Electron session is not isolated. Any detach feature inherits this, so treat it as a dependency rather than something this issue introduces.
  • feat(desktop): restore new-session deep link and add open-session #57246 (PR, open) and [FEATURE]: opencode://new-session in OpenCode 2's desktop app, as in OpenCode 1 #55106 — the open-session deep link. This is the transport the detach action should reuse instead of inventing a new IPC route.
  • fix(desktop): stop Ctrl+W from closing the window on Windows/Linux #54557 (PR, open) and desktop: Ctrl+W closes the whole window instead of the current tab #52683 — active work on tab-vs-window command close semantics in the same dispatch layer. Worth coordinating to avoid a collision.
  • [FEATURE]: Add Delete and Export options to the tab menu #56114 — open request to add Delete and Export to the same tab context menu; confirms this menu is the accepted home for tab actions.

Proposed behaviour

Add one item to the tab context menu, between "Rename" and "Close tab":

  • Label: Open in new window
  • i18n key: common.openInNewWindow
  • Action: create a new window and open that tab's session in it.

When the detached tab is the only tab in its window, keep the source window alive and open the session in the new window. That is predictable and non-destructive. Whether the source tab should then close is a product decision better handled as a follow-up; it is also the point where this feature could become surprising, so it should be explicit.

Implementation sketch (not prescriptive)

Written against dev, where the shell differs from the packaged 1.19.4 bundle: the menu action enum is an Effect RPC schema (packages/desktop/src/shared/ipc-rpc/menu.ts), the dispatch is runDesktopMenuAction in packages/desktop/src/main/native/menu-actions.ts, and the window factory is makeMainWindows().create(id?, early?) in packages/desktop/src/main/windows/index.ts.

  1. Menu item — packages/app/src/shell/titlebar/tab-nav.tsx: a third Menu.Item inside Menu.Context.Content beside common.rename / common.closeTab, with a new onOpenInNewWindow prop.
  2. Action enum — add the member to DesktopMenuAction in packages/desktop/src/shared/ipc-rpc/menu.ts (runtime gate) and to the mirroring @opencode/app/desktop-menu type. This dual declaration is the most likely compile break, so both must change together.
  3. Dispatch — packages/desktop/src/main/native/menu-actions.ts: a new case plus a handler slot alongside createWindow / installCli / relaunch; wire it in packages/desktop/src/main/ipc-handlers/menu.ts.
  4. Window creation with a target — thread an optional session id through makeMainWindows().create(...) and windowArguments(id) in packages/desktop/src/main/windows/bootstrap.ts. packages/desktop/src/shared/window-bootstrap.ts already carries WindowBootstrap { id, firstLaunchPending?, packaged? } through additionalArguments, which is the natural carrier; extend it rather than adding a parallel channel.
  5. Renderer consumption — the new window reads that payload at boot and opens the session instead of Home. If feat(desktop): restore new-session deep link and add open-session #57246 lands first, reuse its open-session deep link as the transport and keep the bootstrap payload to just the action.

A matching command-palette entry could reuse the same handler, but is optional.

Why not just use New Window

Ctrl+Shift+N creates an empty window on Home. The user must then relocate a session they already had open, losing scroll position and any in-flight state in the original window, and then close the old tab by hand. The menu item is nearly the same amount of code but one action instead of three, and it is the only version that can target a specific session programmatically.

Environment

  • OpenCode desktop 1.19.4 (packaged), and dev at time of filing for the source paths above.
  • Windows.
  • Bundle-level evidence gathered from resources/app.asar of the installed app: menu definitions, out/main/index.js, IPC handler names, and a string search of the renderer bundle.

Activity

  1. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 25, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed write-up! To restate the request: add an Open in new window item to the desktop tab context menu, so a session that's already open in a tab can move straight into its own window. Today you have to open an empty window with File > New Window and find the session again.

    I checked the current v2 code, and the tab context menu there also has only Rename and Close tab, so the gap you describe exists in v2 as well. Maintainers will consider it.

    Related items:

    • feat(desktop): restore new-session deep link and add open-session #57246 and feat(desktop): open a session via opencode:// deep link #54187: open-session deep link work, a possible way to open a specific session in a new window
    • [FEATURE]: opencode://new-session in OpenCode 2's desktop app, as in OpenCode 1 #55106: request for the opencode://new-session deep link in v2
    • [FEATURE]: Add Delete and Export options to the tab menu #56114: request for more actions in the same tab context menu
    • feat(app): mark sessions unread from session and tab menus #58221: adds "mark unread" to the session and tab menus
    • fix(desktop): stop Ctrl+W from closing the window on Windows/Linux #54557: Ctrl+W tab-vs-window close behaviour in the same desktop menu code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.