Skip to content

[Bug]: terminal switch --environment doesn't move the local desktop when the paired environment is a desktop app (follow-up to #24688) #31073

Open

Description

@luisvae

Operating system

macOS

Orca version

1.4.230 (local desktop and the paired machine)

Details

Short summary

orca terminal switch --environment <name> --terminal <handle> still doesn't move the local desktop when the paired environment is another machine running the Orca desktop app, not a headless orca serve. #28023 fixed this for headless servers (#24688), but its local fallback only runs when the server answers navigated: false. A paired desktop that has a window navigates its own window and answers navigated: true, so the fallback is skipped.

What happened

Setup: my Mac (macOS 27.0.1, Orca 1.4.230) is paired with a second Mac that runs the full Orca desktop app (also 1.4.230), saved as environment Jeff.

orca terminal switch --environment Jeff --terminal term_<uuid> --json
{
  "ok": true,
  "result": {
    "focus": {
      "handle": "term_<uuid>",
      "tabId": "<tab-id>",
      "worktreeId": "<repo-id>::/Users/<remote-user>/orca/workspaces/<repo>/<worktree>",
      "navigated": true
    }
  }
}

The local window stays on whatever it showed before. I tried two terminals on the paired machine, one of them in a worktree that is visible in my local sidebar, and got the same result both times.

Cause

In src/cli/handlers/terminal.ts:

if (client.isRemote && result.result.focus.navigated === false) {
  result.result.focus.navigated = await revealPairedTerminalOnLocalDesktop(client, terminal)
}

The remote desktop runs terminal.focus with navigation: 'host', reveals the pane in its own window and reports navigated: true. The local terminal.reveal therefore never runs. A side effect is that the paired machine's window jumps instead, which is unexpected for whoever is sitting at it.

Expected

When the CLI runs on a machine whose desktop shows the paired environment, terminal switch --environment should reveal the terminal in this machine's desktop, as #28023 does for headless servers. The PR's own reasoning applies here too: "The desktop on the CLI's own machine is the one to move." Ideally the remote desktop's window shouldn't move at all in this case.

Possible fix

Try revealPairedTerminalOnLocalDesktop whenever client.isRemote, not only when the server says navigated: false. Possibly also skip host-side navigation on the remote when the call comes from a paired client.

How to reproduce

  1. Run the Orca desktop app on two Macs, A and B.
  2. On A, pair with B as a remote Orca server (Settings → Remote Orca Servers), for example as environment B.
  3. Open a terminal in a worktree on B.
  4. On A: orca terminal list --environment B --json to get its handle.
  5. On A: orca terminal switch --environment B --terminal <handle> --json.
  6. Actual: navigated: true, A's window doesn't move and B's window switches. Expected: A's window switches to that terminal.

Anything else

I hit this with a Stream Deck plugin that lists Orca sessions across hosts and jumps to one when you press its key. That's the same use case as #24688 and #28023. Local sessions and the plugin's command are fine; only paired desktops are affected.

Activity

  1. Velm14 commented on Oct 21, 2026

    @Velm14
    Contributor

    Sent a fix in #31527: the CLI now asks this machine's desktop first, so switching to a terminal on a paired desktop moves your window and leaves the other one alone.

  2. GDuparquet commented on Nov 5, 2026

    @GDuparquet

    Same here on 1.4.248 (both machines, macOS): a MacBook paired with a Mac mini that runs the full desktop app. orca terminal switch --environment mac-mini --terminal term_<uuid> --json run on the MacBook answers navigated: true with the Mac mini's runtimeId, the Mac mini window moves, the MacBook window stays put. Our use case: a dashboard running on the Mac mini offers an "open the agent" button, and the person clicking it is usually on the MacBook. Looking forward to #31527.

  3. Thundernerd commented on Nov 11, 2026

    @Thundernerd

    Same on 1.4.253 (macOS) paired with a Linux machine running the Orca desktop app 1.4.251. orca terminal switch --environment devbox --terminal term_abc123 answers navigated: true and the server's window moves while this Mac's stays put. orca worktree activate --worktree id:<repoId>::<path> --environment devbox behaves the same (activated: true, server window moves). Use case: an Orca plugin dashboard with an "Open" button per workspace; for the paired server's workspaces it has no way to show them on the machine the person is at. Looking forward to #31527.

  4. Velm14 commented on Nov 13, 2026

    @Velm14
    Contributor

    Thanks for the repro. #31527 only covers terminal switch, worktree activate and file open --focus (#38927) have the same root cause. I'll put both into a follow-up once #31527 gets a look, it's the same fix pattern.

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

Metadata

Metadata

Assignees

Labels

os:macosIssues affecting macOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions