Skip to content

fix: make chat and terminal links open reliably in default browser#980

Merged
arnestrickmann merged 2 commits intogeneralaction:mainfrom
naaa760:fix/click-chat-ter
Feb 20, 2026
Merged

fix: make chat and terminal links open reliably in default browser#980
arnestrickmann merged 2 commits intogeneralaction:mainfrom
naaa760:fix/click-chat-ter

Conversation

@naaa760
Copy link
Contributor

@naaa760 naaa760 commented Feb 19, 2026

fix : #977

description:

  • Links in chat and terminal sometimes did nothing on click.

What changed

  • chat: Markdown links use openExternal on click so they open in the default browser.
  • Terminal: Link click opens the URL directly (no confirmation modal).

Files

src/renderer/components/ui/markdown-renderer.tsx
src/renderer/components/TerminalPane.tsx

@vercel
Copy link

vercel bot commented Feb 19, 2026

@naaa760 is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link

greptile-apps bot commented Feb 19, 2026

Greptile Summary

This PR fixes link clicking behavior in chat and terminal components. Previously, links sometimes did nothing on click. The changes:

  • TerminalPane: Removed the confirmation modal (ExternalLinkModal) and now opens URLs directly via window.electronAPI.openExternal() when clicked
  • Markdown Renderer: Added onClick handlers to both full and compact link components (<a> tags) that prevent default navigation and call openExternal() for HTTP/HTTPS URLs

The implementation properly validates URLs (checks for https?:// protocol), includes error handling (catch blocks), and maintains security by using Electron's shell.openExternal() API which validates URLs on the main process side before opening.

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • The changes are straightforward UI improvements that fix a real user-facing bug. The implementation uses existing, validated IPC handlers for opening external URLs, includes proper error handling, and validates URL protocols client-side. No security issues introduced.
  • No files require special attention

Important Files Changed

Filename Overview
src/renderer/components/TerminalPane.tsx Removed confirmation modal for terminal links, now opens URLs directly via openExternal
src/renderer/components/ui/markdown-renderer.tsx Added onClick handlers to markdown links to call openExternal directly, preventing default navigation

Sequence Diagram

sequenceDiagram
    participant User
    participant Renderer as Renderer<br/>(Chat/Terminal)
    participant IPC as Electron IPC
    participant Main as Main Process
    participant Shell as OS Shell

    User->>Renderer: Clicks link
    Renderer->>Renderer: Validate URL (https?://)
    Renderer->>Renderer: e.preventDefault()
    Renderer->>IPC: openExternal(url)
    IPC->>Main: app:openExternal handler
    Main->>Main: Validate URL type
    Main->>Shell: shell.openExternal(url)
    Shell-->>User: Opens in default browser
Loading

Last reviewed commit: 1809f98

@arnestrickmann
Copy link
Contributor

thanks @naaa760, do you know what was the issue before that opening links wasnt working consistently?

Could you run pnpm run format before I'm merging this?

@arnestrickmann
Copy link
Contributor

thanks @naaa760, do you know what was the issue before that opening links wasnt working consistently?

Could you run pnpm run format before I'm merging this?

this would be amazing @naaa760

@naaa760
Copy link
Contributor Author

naaa760 commented Feb 20, 2026

@arnestrickmann

  • Chat: In Electron, plain links often don’t open in the system browser. we now intercept the click and use openexternal so they always open correctly.
  • Terminal: Links only opened after a confirmation modal. we now open them directly on click so they always work.

@arnestrickmann
Copy link
Contributor

great, have you tested it?
@naaa760

@naaa760
Copy link
Contributor Author

naaa760 commented Feb 20, 2026

@arnestrickmann
Yes i ran the test suite and manually checked link clicks in markdown and the terminal both open in the default browser.

@arnestrickmann
Copy link
Contributor

amazing, thank you. could you run pnpm run format?

Co-authored-by: Cursor <cursoragent@cursor.com>
@arnestrickmann
Copy link
Contributor

Thanks! @naaa760

@arnestrickmann arnestrickmann merged commit e8ea0b1 into generalaction:main Feb 20, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Clicking links in chat and terminal not working consistently

2 participants