[BUG] Ctrl-click on a link in Windows Terminal opens it twice (terminal opens it, then Claude Code opens it again)

Status Open
Reported on v2.1.259
Maintainer reply None cached
Activity 1 comment · opened Sep 3, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

In Windows Terminal, ctrl-clicking any link rendered by Claude Code (markdown link, bare URL, or a link with descriptive text) opens the URL twice in the default browser, so two identical tabs appear. Links printed by every other program in the same terminal open once.

What Should Happen?

One tab per ctrl-click, like every other program in the terminal.

Error Messages/Logs

Root cause (verified)

Both the terminal and Claude Code act on the same ctrl-click:

1. Windows Terminal opens the OSC 8 hyperlink itself on ctrl-click. This happens even while the application has mouse reporting enabled.
2. Windows Terminal also forwards the ctrl-click to the application as an SGR mouse report with the ctrl modifier bit set (button code 16), e.g. ESC[<16;3;9M / ESC[<16;3;9m.
3. Claude Code receives that report and opens the link too.

Windows Terminal does not treat "I handled the hyperlink" and "forward the click to the app" as mutually exclusive, so any TUI that opens links on ctrl-click double-opens there. Claude Code should not open a link on a ctrl-modified click when the terminal is known to handle ctrl-click hyperlinks itself (Windows Terminal via WT_SESSION), or should only open on an unmodified click.

Evidence

All tests done in a plain PowerShell 7 tab in Windows Terminal, outside Claude Code.

- OSC 8 link printed by PowerShell, no mouse reporting: ctrl-click opens ONE tab.
- OSC 8 link printed with ?1000h ?1006h mouse reporting enabled: ctrl-click still opens ONE tab, so the terminal opens hyperlinks even under mouse reporting.
- Node script with raw mode and mouse reporting enabled, logging stdin: plain click yields ESC[<0;col;rowM + ESC[<0;col;rowm, ctrl-click yields ESC[<16;col;rowM + ESC[<16;col;rowm. The ctrl-click is forwarded to the application.
- In Claude Code: plain click on a link does nothing, shift-click does nothing, ctrl-click opens TWO tabs, shift+ctrl-click (Windows Terminal's mouse-reporting bypass) opens ONE tab.
- With CLAUDE_CODE_DISABLE_MOUSE_CLICKS=1 (scroll-only mouse mode), ctrl-click opens ONE tab. That confirms the second open comes from Claude Code's click handling. It is not a usable workaround because it also disables clicking on options, subagent tabs and drag selection.

Steps to Reproduce

  1. Windows 11, Windows Terminal, PowerShell 7, Firefox as default browser (any browser should do).
  2. Start claude (tui: fullscreen, though the OSC 8 links are the same in default mode).
  3. Ask it to print Example or a bare https://example.com.
  4. Ctrl-click the rendered link.
  5. Two tabs open.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.259

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Environment

  • Claude Code 2.1.259 (native installer, ~/.local/bin/claude.exe)
  • Windows Terminal 1.24.11911.0 (Store), default settings, experimental.detectURLs untouched
  • Windows 11 Pro 10.0.26200
  • PowerShell 7 (pwsh)
  • Firefox as default browser
  • ~/.claude/settings.json has "tui": "fullscreen"

Workarounds found

  • Shift+ctrl-click inside Claude Code (bypasses mouse reporting, only the terminal opens it).
  • CLAUDE_CODE_DISABLE_MOUSE_CLICKS=1, but that loses all click interaction in the TUI.
  • experimental.detectURLs=false in Windows Terminal does NOT help; the double comes from OSC 8 plus forwarded click, not regex detection.

Related

  • #68568 (JetBrains terminal delivers duplicate click events, links open twice). Different mechanism, same symptom.
  • #71687 (CLAUDE_CODE_DISABLE_MOUSE_CLICKS undocumented).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗