Skip to content

Option to require a modifier key (cmd/ctrl) to open URLs on click #2344

Description

@ukohank517

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

Problem

When mouse_capture is enabled (the default), Herdr opens plain-text URLs on a bare left click. In agent panes this is very easy to trigger accidentally: agents like Claude Code print lots of URLs, and a click meant to focus a pane or place the cursor ends up opening a browser tab instead.

For comparison, this is how the same click behaves across setups (macOS, Ghostty as host terminal):

Setup Bare click on a URL
Ghostty running the agent directly does not open (Ghostty requires cmd+click while the app captures the mouse)
Herdr with mouse_capture = true opens (Herdr's own link handling)
Herdr with mouse_capture = false opens (falls through to Ghostty, which sees no mouse-capturing app)

So there is currently no configuration that keeps Herdr's mouse UI (pane focus, sidebar clicks) while preventing accidental link opens — mouse_capture = false loses the mouse UI entirely and still opens links on bare click via the host terminal.

Proposed solution

A config option to require a modifier for opening links, following the convention Ghostty and other terminals use:

[ui]
# "" (default): current behavior, bare click opens links
# "cmd" / "ctrl" / "alt": links open only while the modifier is held
link_open_modifier = "cmd"

With the modifier configured, a bare click would only do normal Herdr mouse UI actions (focus, selection) and never navigate.

Environment

  • Herdr 0.8.0 (stable)
  • macOS, Ghostty as the host terminal

Expected behavior

A bare left click inside a pane should only perform Herdr's normal mouse UI actions (focus the pane, place selection) and never navigate. Opening a link should require an explicit modifier, following the convention host terminals use — e.g. a config option like:

[ui]
# "" (default): current behavior, bare click opens links
# "cmd" / "ctrl" / "alt": links open only while the modifier is held
link_open_modifier = "cmd"

Default can stay as today's behavior so nothing changes for existing users.

Reproduction

  1. Run Herdr (0.8.0, default config, mouse_capture = true) in Ghostty on macOS.
  2. Start an agent that prints URLs in a pane (e.g. Claude Code — it outputs docs links, PR URLs, etc.).
  3. Left-click a URL in the pane output with no modifier held — for example while trying to focus that pane or place the cursor.
  4. The URL opens in the browser immediately.

For comparison, running the same agent directly in Ghostty (no Herdr) does not open the URL on a bare click: Ghostty requires cmd+click while an application is capturing the mouse. mouse_capture = false doesn't help either — Herdr's mouse UI (pane focus, sidebar clicks) stops working, and bare clicks still open links because they fall through to Ghostty, which now sees no mouse-capturing app.

Impact

Accidental browser tabs many times a day in normal agent-herding use: agent output is dense with URLs, and clicking panes to focus them is a core interaction, so the two collide constantly. There is currently no configuration that avoids this without giving up Herdr's mouse UI entirely.

Environment

Herdr 0.8.0 (stable), macOS (Darwin 25), Ghostty as host terminal

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