8000 feat: setting to open terminal/markdown links in the system default browser (not just Ctrl+click) · Issue #201 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

feat: setting to open terminal/markdown links in the system default browser (not just Ctrl+click) #201

Closed

Description

@chenx0414

Summary

Add a setting to make terminal/markdown links open in the system default browser instead of the wmux browser panel — ideally as a global default toggle (with Ctrl/Cmd+click still available to force the opposite behavior).

Current behavior

Clicking an http(s) link in a terminal or markdown pane always routes it into the wmux browser panel (navigate the existing browser surface, or split a new browser pane if none exists). There is currently no way to change the default to the external browser:

  • src/renderer/utils/open-in-browser.ts → openInWmuxBrowser(url, { forceExternal }) always opens in the panel unless forceExternal is set.
  • src/renderer/utils/terminal-links.ts and src/renderer/components/Markdown/MarkdownPane.tsx only set forceExternal when ctrlKey/metaKey is held.
  • wmux-browser-prefs (src/renderer/store/settings-slice.ts / BrowserSettings.tsx) has no link-open option; only searchEngine, openOnStartup, and devToolsIcon.

So the only built-in way today is Ctrl/Cmd+click, which is easy to miss and links that are opened by the same gesture need every click to be a modified one.

Proposed solution

  1. Add a browserPrefs option, e.g. openLinksExternally: boolean (default false to preserve current behavior).
  2. When enabled, openInWmuxBrowser routes links to system.openExternal by default, and Ctrl/Cmd+click inverts it back to the wmux panel.
  3. Surface it in Settings → Browser as a checkbox.
  4. Optionally update the README's "Clickable links" line to document the setting.

This is especially useful for users who prefer to do most browsing in their own browser while still enjoying wmux's live browser panel for agent (Claude Code / CDP) sessions.

Activity

  1. amirlehmam commented on Aug 24, 2026

    @amirlehmam
    Owner

    Implemented, shipping in v1.13.0. Thanks for the unusually precise report — you'd already located every touch point (open-in-browser.ts, terminal-links.ts, MarkdownPane.tsx, browserPrefs), and the implementation landed on exactly those files.

    Settings → Browser → "Open links in the system browser", defaulting to off so nothing changes on upgrade.

    One deliberate difference from the proposal

    Your step 2 said Ctrl/Cmd+click "inverts it back to the wmux panel", and that's what I built — but I want to be explicit about it, because the tempting simplification is wrong.

    Ctrl/Cmd now inverts the setting rather than forcing the external browser. If it kept forcing external, then anyone who turned the setting on could never reach the panel again — a strictly worse position than the Ctrl+click-only behaviour this issue is about, since it trades one missing destination for another. As an inversion, whichever default you pick, the other destination stays one modifier away. The setting changes which one costs a keypress; nobody loses a capability.

    That case — setting on, Ctrl+click, expect the panel — is the one most likely to regress, so it's pinned as its own test.

    How it's wired

    The rule lives in one place, linkOpensExternally in open-in-browser.ts:

    export function linkOpensExternally(preferExternal: boolean, invert: boolean | undefined): boolean {
      return invert ? !preferExternal : preferExternal;
    }

    The two callers now report only whether the modifier was held and have no opinion about what it means — so the old { forceExternal } option is gone rather than kept alongside the new one. Two ways to express where a link goes is how they drift apart.

    browserPrefs persists as a whole block, so adding a new key (rather than changing an existing default) means existing users get openLinksExternally: false merged in automatically — no migration step.

    Also done: the Settings checkbox with an explanatory hint, strings translated across all 18 bundled locales rather than English-only, and the README's "Clickable links" line updated as you suggested.

    1,557 tests passing.

    On your closing note

    especially useful for users who prefer to do most browsing in their own browser while still enjoying wmux's live browser panel for agent (Claude Code / CDP) sessions

    That's precisely why it's an inversion and not a mode. Agent-driven navigation (wmux browser open, CDP) never goes through this path at all — it targets a browser surface directly — so turning the setting on leaves the agent panel working exactly as before. You get your own browser for the links you click, and the panel keeps doing what it's for.

  2. amirlehmam commented on Aug 24, 2026

    @amirlehmam
    Owner

    Released: v1.13.0 — installer and portable zip are both up, and the installer path auto-updates.

    The setting is under Settings → Browser → Open links in the system browser.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0