desktop / desktop/desktop

Add a way to open/switch a repository without activating the app

Open
#22,150 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
21.8k
Forks
10.5k
Avg merge
1d 15h
Merged PRs (30d)
25

Description

### Use case

I'm building a small editor integration (VSCode extension) that, when my editor regains focus, tells GitHub Desktop to switch to the repo of the current workspace so GitHub Desktop stays in sync with what I'm working on. The intent is purely a background hand-off — GitHub Desktop should silently update its selected/active repo and fetch, while focus stays on the editor.

### Problem

Every channel I've found to trigger "open this repo" causes GitHub Desktop to take focus, even when the launcher explicitly asks it not to:

- `open -g "x-github-client://openRepo/https://github.com//"` — still activates
- `open -g -a "GitHub Desktop" --args --cli-open=/path/to/repo` (same mechanism the bundled `github` CLI uses) — still activates
- `osascript -e 'tell application "GitHub Desktop" to open POSIX file "…"'` — still activates

The `-g` flag is honored by `open`/`LaunchServices`, so this isn't a launcher issue — the activation happens inside the app, presumably because the `open-url` / second-instance / `open-file` handlers call `mainWindow.show()` and `focus()` unconditionally on the way to selecting the repo.

### Proposal

Provide an opt-in "don't activate" path. Either of these would solve it:

1. **URL-scheme query param**, e.g.
`x-github-client://openRepo/?activate=false`
When present, the handler selects the repo and triggers a fetch but skips the `show()`/`focus()` calls (and doesn't unminimize the window if it's hidden).

2. **A new CLI flag**, e.g. `--cli-open-background=`, with the same semantics on the second-instance / cold-start path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.