Skip to content

Links in git hook output show a confirmation dialog but never open the URL #23211

Open

Description

@navtoj

The problem

When a hook fails, the "Commit failed" dialog shows the hook's output. If that output contains an OSC 8 hyperlink, the linked text is shown with a dashed underline, which becomes solid on hover.

Clicking it shows a confirmation dialog with Cancel and OK buttons:

Do you want to navigate to https://example.com?

WARNING: This link could potentially be dangerous

Pressing OK closes the dialog, but the URL does not open, either in GitHub Desktop or in the default browser.

Release version

Version 3.6.11 (arm64)

Operating system

macOS 27.2.1 (26B131)

Steps to reproduce the behavior

  1. In a terminal, create a repository with a failing pre-commit hook:

    mkdir github-desktop-issue-23211
    cd github-desktop-issue-23211
    git init
    echo test > file.txt
  2. Create .git/hooks/pre-commit with this content and make it executable:

    touch .git/hooks/pre-commit
    chmod +x .git/hooks/pre-commit
    #!/usr/bin/env bash
    printf '\033]8;;https://example.com\a%s\033]8;;\a\n' 'Click me'
    exit 1
  3. In GitHub Desktop, add the repository (File > Add Local Repository).

  4. Select file.txt and commit it.

  5. In the "Commit failed" dialog, click the underlined "Click me" text.

  6. In the confirmation dialog, press OK.

Result: nothing opens.

Log files

2026-11-19T19:30:59.136Z - info: [ui] [AppStore] loading 5 repositories from store
2026-11-19T19:30:59.137Z - info: [ui] [AppStore] found account: navtoj (Navtoj Chahal)
2026-11-19T19:30:59.147Z - info: [ui] Subscribed 'navtoj' to Alive channel
2026-11-19T19:30:59.544Z - info: [ui] launching: 3.6.11 (Mac OS 27.2.1)
2026-11-19T19:30:59.544Z - info: [ui] execPath: '/Applications/GitHub Desktop.app/Contents/Frameworks/GitHub Desktop Helper (Renderer).app/Contents/MacOS/GitHub Desktop Helper (Renderer)'
2026-11-19T19:31:03.557Z - error: [ui] `git commit -F -` exited with an unexpected code: 1.
�]8;;https://example.com�Click me�]8;;�

2026-11-19T19:31:03.557Z - info: [ui] [Timing] Action 'create commit' for 'github-desktop-issue-23211' took 0.034s
2026-11-19T19:31:23.989Z - warn: [main] Prevented new window to: about:blank

Screenshots

Screenshot 2026-11-19 at 12 28 35 PM

Additional context

The escape sequence is the standard OSC 8 format:

ESC ] 8 ; ; URL BEL text ESC ] 8 ; ; BEL

Using the ST terminator (ESC \) instead of BEL gives the same result.

Activity

  1. desktop-triage commented on Nov 19, 2026

    @desktop-triage

    Triage: this reproduces a real bug in the embedded terminal's handling of OSC 8 hyperlinks, not a configuration or environment issue — classifying as bug (HIGH confidence), priority-3 (MEDIUM confidence, since a workaround — opening the URL manually — exists and affects a narrow scenario). No duplicate issues were found after searching for related terminology (OSC 8, hyperlinks, commit-failed dialog links); the closest related issue, #21785 ("unable to copy text from 'Commit failed' modal"), addresses a different problem (clipboard copy) in the same dialog.

    Initial hypothesis

    GitHub Desktop renders hook/git output in an @xterm/xterm Terminal instance without configuring a custom linkHandler option. xterm.js detects OSC 8 hyperlinks itself (OscLinkProvider), and when no linkHandler is supplied it falls back to its built-in defaultActivate, which calls confirm(...) with exactly the "Do you want to navigate to ... WARNING: This link could potentially be dangerous" text seen in the report, and on OK calls window.open() then sets newWindow.location.href to the URL. GitHub Desktop's main process registers a blanket contents.setWindowOpenHandler in main.ts that denies every new window and logs Prevented new window to: <url> — matching the Prevented new window to: (redacted) line in the attached log right after the OK click. Because window.open()returns a window whose navigation is then blocked, the link silently fails to open. The fix would involve supplying a customlinkHandler.activateto theTerminalcomponent that opens the URL viashell.openExternal(asLinkButton` already does) instead of relying on xterm.js's browser-oriented default.

    Generated by Issue Triage (skills-driven) for #23211 · auto · 153.5 AIC · ⊞ 4.7K · ◷

  2. added
    bug
    priority-3
    on Nov 19, 2026
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

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions