Skip to content

feat(terminal): open custom app scheme links with user approval - #13237

Open
bbingz wants to merge 3 commits into
stablyai:mainfrom
bbingz:feat/13225-terminal-custom-scheme-links
Open

bbingz wants to merge 3 commits into
stablyai:mainfrom
bbingz:feat/13225-terminal-custom-scheme-links

Conversation

@bbingz

@bbingz bbingz commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Desktop terminal links such as obsidian:// and vscode:// now support an explicit OS handoff. Cmd-click on macOS or Ctrl-click on other platforms opens a main-process Open/Cancel dialog with the full URL; Cancel is the default. Ordinary clicks, missing mouse events and the wrong platform modifier cannot launch the custom-scheme confirmation path.

The gesture applies to detected text links, OSC 8 links and popout previews. Main classifies every request, rejects denied schemes and serializes confirmation dialogs. Existing HTTP(S) link actions and file-link routing remain intact. Web clients retain HTTP(S)-only opening because they have no equivalent native confirmation surface.

Partially addresses #13225. Remembered permissions and a Settings revocation list remain outside this change. Related: #13240 carries the embedded-browser surface. Both currently include the shared classifier and opening helper independently; reconcile those shared files when either lands.

Validation

At ba57c32610baa33963285c68b95995d156296ed2:

  • Independent verification: 374 tests passed and 1 skipped across 37 files, covering plain-click rejection, platform modifiers, OSC links, popouts, tooltips, IPC classification and web behavior.
  • CLI, Node and Web TypeScript checks passed with --composite false; changed-file lint, formatting, diff whitespace and native-runtime preflight passed.
  • Independent Cursor security review passed for this exact commit with no medium-or-higher findings.

Full repository tests, packaged builds and a manual registered-app launch were not run. Unit tests mock the native confirmation dialog. No new RPC or stream opcode; terminal gestures and the desktop main-process gate also apply to SSH and folder workspaces.

AI disclosure

Cursor ported and reviewed this change; Codex independently checked the code and validation results before updating the PR.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added shared classification for HTTP(S), custom application, denied, and invalid URLs. Updated shell IPC and web shell handling to confirm custom schemes before opening them. Extended terminal link detection to recognize custom application schemes and route them through the shell API. Added tests for classification, URL matching, IPC confirmation, cancellation, direct opening, and denied schemes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and tests, but it omits most required template sections, including visual proof, review, checklist, and complete linked-issue details. Use the repository template headings, add visual proof or an N/A reason, complete the linked issue, document testing platforms, and complete the review and checklist sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: opening custom terminal application-scheme links with user approval.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c2c0281-c6f6-47f8-a33a-f0773a14f00a

📥 Commits

Reviewing files that changed from the base of the PR and between 6da7b8e and de2b849.

📒 Files selected for processing (7)
  • src/main/ipc/shell.test.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/shared/external-app-url.test.ts
  • src/shared/external-app-url.ts

Comment thread src/shared/external-app-url.ts Resolved
bbingz added a commit to bbingz/orca that referenced this pull request Aug 8, 2026
Review follow-up for stablyai#13237: hover hints for app schemes describe registered-app
open (not Orca/browser), and the terminal URL regex skips denied schemes and
uppercase false positives like Error://.
@bbingz

bbingz commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Review follow-up (batch 4)

Addressed confirmed medium findings:

  1. Tooltips — custom app schemes show “open in the registered app” instead of HTTP/Orca browser hints (defaultLinkTooltipText + formatTerminalUrlTooltip).
  2. urlRegex — exclude denied schemes (file, javascript, chrome, …) with lookbehind so partial restarts like ile:// do not match; custom schemes are lowercase-only to drop noise like Error://.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/shared/external-app-url.test.ts (1)

72-78: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression test for uppercase false positives.

The terminal matcher must reject Error://... while it accepts lowercase custom schemes. Add an uppercase-scheme case to this input and keep the toBeNull() assertion. This prevents a future case-insensitive regex from linkifying log text as an application URL.

Based on the PR objectives, terminal matching must reject uppercase custom-scheme false positives.

src/renderer/src/lib/pane-manager/pane-dom-creation.ts (1)

22-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Centralize the custom-scheme tooltip hint.

pane-dom-creation.ts duplicates the platform check and label text already provided by getTerminalCustomAppSchemeOpenHint() in src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts, Line 69 through Line 73. Move this logic to a dependency-neutral helper or reuse the existing helper while preserving the runtime guard. This prevents the two tooltip paths from drifting.

Based on the provided cross-file context, the same custom-scheme hint helper already exists in src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e2d78bd4-138e-49e1-bc75-4e54ee76db71

📥 Commits

Reviewing files that changed from the base of the PR and between de2b849 and d294c1f.

📒 Files selected for processing (7)
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/external-app-url.test.ts
  • src/shared/external-app-url.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/shared/external-app-url.ts

Comment thread src/renderer/src/web/web-preload-api.ts Resolved
@bbingz

bbingz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Backlog note (cleanup pass): auto-rebase onto current main hit conflicts. Branch left open; needs manual conflict resolution or a fresh PR before it can land. Not abandoned — just conflicted.

@bbingz bbingz closed this Aug 10, 2026
@bbingz
bbingz force-pushed the feat/13225-terminal-custom-scheme-links branch from d294c1f to 9ccec55 Compare August 10, 2026 03:38
bbingz added a commit to bbingz/orca that referenced this pull request Aug 10, 2026
Review follow-up for stablyai#13237: hover hints for app schemes describe registered-app
open (not Orca/browser), and the terminal URL regex skips denied schemes and
uppercase false positives like Error://.
@bbingz bbingz reopened this Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/shared/external-app-url.test.ts (1)

29-58: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add regression cases for the remaining scheme boundaries.

Add a classifier assertion that vbscript: returns reason: 'denied'. Add terminal matching coverage that rejects both vbscript: and uppercase Error:// text. These cases protect the explicit denial and lowercase-only policies from future matcher changes.

Proposed test additions
   it('denies dangerous schemes', () => {
+    expect(classifyExternalAppUrl('vbscript:msgbox(1)')).toEqual({
+      ok: false,
+      reason: 'denied'
+    })
     expect(classifyExternalAppUrl('javascript:alert(1)')).toEqual({
       ok: false,
       reason: 'denied'
@@
   it('does not linkify denied schemes', () => {
     const text =
-      'file:///etc/passwd javascript:alert(1) chrome://settings data:text/html,hi smb://host/share jnlp://x/app.jnlp'
+      'file:///etc/passwd javascript:alert(1) vbscript:msgbox(1) Error://report chrome://settings data:text/html,hi smb://host/share jnlp://x/app.jnlp'

As per PR objectives, vbscript: must be denied and Error:// must not qualify as a custom link.

Also applies to: 73-78


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8f0c1d0-31e6-4519-9170-6c33b31d0426

📥 Commits

Reviewing files that changed from the base of the PR and between 9ccec55 and cd30edf.

📒 Files selected for processing (11)
  • src/main/ipc/shell.test.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/external-app-url.test.ts
  • src/shared/external-app-url.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/main/ipc/shell.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts

@bbingz
bbingz force-pushed the feat/13225-terminal-custom-scheme-links branch from cd30edf to 89e063f Compare August 11, 2026 05:06
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/shared/external-app-url.test.ts (1)

29-58: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the documented denied-scheme and lowercase-scheme rules.

The suite does not test vbscript:. The terminal matcher also does not test that Error:// is not linkified. Add both cases to prevent policy regressions.

Proposed test additions
   it('denies dangerous schemes', () => {
+    expect(classifyExternalAppUrl('vbscript:msgbox(1)')).toEqual({
+      ok: false,
+      reason: 'denied'
+    })
     expect(classifyExternalAppUrl('javascript:alert(1)')).toEqual({
       ok: false,
       reason: 'denied'
     })
     const text =
-      'file:///etc/passwd javascript:alert(1) chrome://settings data:text/html,hi smb://host/share jnlp://x/app.jnlp'
+      'file:///etc/passwd javascript:alert(1) vbscript:msgbox(1) chrome://settings data:text/html,hi smb://host/share jnlp://x/app.jnlp Error://open'

Also applies to: 73-78


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f86aeafd-21e2-449d-89a5-5659171b937d

📥 Commits

Reviewing files that changed from the base of the PR and between 1928ca5 and 89e063f82b124e2fc8394bd497341c58127c7f3e.

📒 Files selected for processing (11)
  • src/main/ipc/shell.test.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/external-app-url.test.ts
  • src/shared/external-app-url.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/external-app-url.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/main/ipc/shell.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts

@bbingz

bbingz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review (contributor priority pack)

  • Rebased / checked against current main where needed
  • Scoped bugfix; summary + test plan in the description
  • Community PR: please Approve and run workflows when convenient (fork CI stays off)
  • No maintainer merge expected from us — happy to iterate on review comments

Part of a short priority list for maintainers: P0 #13609 #13566 · hot #13710 #13692 #13691 #13536 #13572 #8072 #13237 · easy #13570 #13561 #13255.

bbingz added a commit to bbingz/orca that referenced this pull request Aug 11, 2026
Review follow-up for stablyai#13237: hover hints for app schemes describe registered-app
open (not Orca/browser), and the terminal URL regex skips denied schemes and
uppercase false positives like Error://.
@bbingz
bbingz force-pushed the feat/13225-terminal-custom-scheme-links branch from 89e063f to e4b91a3 Compare August 11, 2026 19:26
@bbingz
bbingz force-pushed the feat/13225-terminal-custom-scheme-links branch from e4b91a3 to c06c82a Compare August 13, 2026 00:02
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c0b1e34-db79-485c-a103-b65ed82436a0

📥 Commits

Reviewing files that changed from the base of the PR and between ef8eea5 and c06c82a8d9ffcd3507d3b16a7fa724c5e69d62bc.

📒 Files selected for processing (11)
  • src/main/ipc/shell.test.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/external-app-url.test.ts
  • src/shared/external-app-url.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/main/ipc/shell.test.ts
  • src/main/ipc/shell.ts
  • src/renderer/src/components/terminal-pane/terminal-web-link-click.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/terminal-pane/terminal-link-open-hints.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-links.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/shared/external-app-url.ts

Comment thread src/shared/external-app-url.test.ts Resolved
@bbingz

bbingz commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Relationship note — paired with #13240; they share a module.

Both PRs add src/shared/external-app-url.ts (+ test), and they address the same failure in two surfaces:

  • here (terminal): terminal-osc-link-routing.ts handleOscLink falls through to return false for any non-http/https/file scheme, so an obsidian:// OSC-8 link does nothing and says nothing;
  • feat(browser): prompt before opening custom app protocol links #13240 (embedded browser): browser-manager.ts navigationGuard calls event.preventDefault() on a same-tab custom-scheme navigation without emitting any event, so it fails silently too.

They should be reviewed together and only one of them should carry external-app-url.ts — happy to move it into whichever lands first. If the "confirm, then hand off to the OS" interaction isn't wanted at all, that decision applies to both and I'll close both.

bbingz and others added 3 commits September 20, 2026 18:50
Co-authored-by: Cursor <cursoragent@cursor.com>
Plain clicks were treated as owned gestures and opened the confirm dialog.
Keep HTTP action menus; custom openExternal stays on platform-correct direct activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bbingz
bbingz force-pushed the feat/13225-terminal-custom-scheme-links branch from ba57c32 to 0fd7515 Compare September 20, 2026 10:53
@DemiAsh

DemiAsh commented Oct 1, 2026

Copy link
Copy Markdown

Thanks for this, it fixes exactly the case from #13225 that we keep hitting: agents print OSC 8 links to a local app with its own URL scheme, and today those links are dead in Orca, while the same links open fine from iTerm2 or Terminal.app.

Is anything blocking a maintainer review? The PR has been open since 2026-08-08. It is mergeable now, but fork CI has not run (workflows need approval). @bbingz, happy to help test on macOS (Apple Silicon) with a real registered scheme if that's useful.

@michalkechner-impact

Copy link
Copy Markdown

👍

@bbingz

bbingz commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @DemiAsh and @michalkechner-impact, and sorry for the silence. The browser half of this landed in #30490, which asks before a page opens another app. I'd like to route terminal OSC 8 custom-scheme links through that same main-process prompt instead of keeping this PR's own deny list, but that needs one choice from the maintainers first:

  1. A dedicated IPC (for example shell:openExternalAppLink) that reuses feat(browser): ask before a page opens another app #30490's prompt with the window as the requester. Main window only, and no change for existing callers.
  2. Widening shell:openUrl so every custom-scheme link in Orca asks first. Today it drops non-http(s) URLs silently, and about 120 renderer call sites pass external content through it, so this changes behavior well beyond the terminal.

I lean toward 1. Once that's settled I'll re-port this onto current main and post the new head here. DemiAsh, your offer to test on Apple Silicon would help at that point.

@aspiers

aspiers commented Nov 8, 2026

Copy link
Copy Markdown

@bbingz, I'd like this to land too: my agents print beads:// links as OSC 8 hyperlinks, and in Orca they do nothing when clicked. I've rebased your three commits onto current main (89422778ee8) to save you the conflict work. Your authorship is kept.

Branch: aspiers:feat/terminal-custom-scheme-links (compare with main)

What moved and how I resolved it

  • main moved the terminal link code under terminal-pane/links/ (refactor(terminal): organize input, clipboard, links and completion owners #39113, refactor(renderer): organize terminal pane lifecycle and layout owners #39242). I re-applied your changes at the new homes: OSC routing in links/terminal-osc-link-routing.ts, the web-link click in links/http/terminal-web-link-click.ts, and the tooltip in links/terminal-url-tooltip.ts (it used to live in terminal-pane-lifecycle-primitives.ts).
  • In pane-dom-creation.ts and shell.ts I kept main's restructuring and added your regex, tooltip and openExternalAppUrlWithUserApproval call on top.
  • I dropped the hunk in the second commit for dashboard-popout/preview-terminal-links.ts, along with its new test. main's preview now gates every link on isTerminalLinkDirectActivation, which is the check that hunk added for custom schemes.
  • main has since deleted some test files as low value (test: remove 332 low-value renderer tests #37517, test: remove 2,191 low-value test declarations #38113): terminal-link-open-hints.test.ts and pane-dom-creation.test.ts. I dropped your hunks in those and also left out the tooltip test, since it only checks copy, which AGENTS.md rules out. Your other tests are ported unchanged. The first two commit messages carry a bracketed note about these changes.

I added one commit of my own on top. Since this PR was written, main replaced xterm's default URL regex with a prose-aware TERMINAL_HTTP_URL_REGEX (#37449 and others). Swapping in TERMINAL_WEB_AND_APP_URL_REGEX as it stood would have regressed three cases: http://[::1] became http://[::1, links ran on past CJK sentence punctuation, and Https:// stopped matching. The commit builds the custom-scheme regex on the same URL body (PROSE_URL_AFTER_SCHEME_SOURCE, split out of prose-url-boundary.ts) and adds a test for those cases. Custom schemes stay lowercase-only.

Testing

  • pnpm tc passes, and so does the changed-code quality gate (0 findings across 17 files).
  • pnpm check:changed passes 31 of 32 checks, unit tests included. The failure is below.
  • I ran a throwaway Playwright spec against the e2e build, on Linux, on an Xvfb display with a private D-Bus session and a test x-scheme-handler registered in temporary XDG dirs:
    • A plain click on an OSC 8 beads://projects/demo/x#comments link shows no prompt.
    • Ctrl+click shows the native "Open this beads link in the registered app?" box with the full URL. Clicking Open runs xdg-open, and the handler received the exact URL.
    • A plain-text orcatest://plain/demo link is underlined, and its tooltip reads "Ctrl+click to open in the registered app". Ctrl+click prompts, and pressing Enter takes the default (Cancel), so nothing opens.
    • One caveat: the e2e build stubs shell.openExternal, so the spec replaced it with xdg-open <url>. That's what Electron itself runs on Linux (shell/common/platform_util_linux.cc at v43.0.0). I haven't tried macOS or Windows.

Still open

direct-link-open-ratchet fails. The two new renderer calls to window.api.shell.openUrl for custom schemes (OSC routing and the web-link click) push two files over their baseline of zero. I think this is the same question you put to the maintainers on 2026-10-25:

  1. A dedicated IPC for custom-scheme links, ideally reusing feat(browser): ask before a page opens another app #30490's prompt. The renderer would call a new preload method instead of shell.openUrl, so the ratchet passes and shell:openUrl stays http-only for its other callers.
  2. Widening shell:openUrl, which is what this branch still does. The ratchet would then need two baseline entries, which goes against its "counts only go down" rule.

The ratchet points toward option 1, which matches your preference. One smaller point: src/shared/external-app-url.ts keeps its own deny list, while #30490 added NEVER_EXTERNAL_APP_PROTOCOLS in browser-external-app-launch.ts. They differ (smb:, jnlp: and ms-msdt: on one side, afp:, disk: and nntp: on the other), and option 1 would be a natural point to merge them.

Maintainers, could you pick 1 or 2? @bbingz, you're welcome to reset your branch to mine and force-push, or I can open a replacement PR with your commits and authorship intact, whichever you prefer. I can also do the option 1 rework once it's decided.

Written by Claude, intent from @aspiers.

@bbingz

bbingz commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for rebasing the three commits and for the prose-boundary fix. I checked the branch rather than force-pushing it.

aspiers:feat/terminal-custom-scheme-links is d952cda35142. Against today's main (9ef5e48f097) the compare is 4 ahead and 480 behind: three commits still authored by Bing.Z, then fix(terminal): keep main's HTTP link boundaries for custom-scheme links. The base in your note, 89422778ee8, is the 2026-11-08 commit that removed 11 low-value agent-status tests.

I am leaving this PR at 0fd7515b31f. The rebased branch still calls shell.openUrl for custom schemes, so direct-link-open-ratchet stays red, and no maintainer has chosen between a dedicated IPC and widening shell:openUrl. Force-pushing would replace the current head with a snapshot that is 480 commits behind and still blocked on that choice. A second PR would file the same question again.

Your branch is the right base once a maintainer picks the dedicated IPC. I did not re-run pnpm tc, the changed-code gate, or the Linux Playwright spec.

@michalkechner-impact

Copy link
Copy Markdown

Small note in case it helps with the option 1 vs 2 choice: #42845 landed on 15.11 and added "Always allow" to the #30490 prompt. From its description it remembers per site and scheme, browser tabs only. If option 1 reuses that prompt, terminal links might get a remembered choice too, maybe per scheme. Fine to leave that for later though, a prompt on every click already fixes the dead links for me.

@bbingz

bbingz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — I read #42845. It adds an unchecked "Always allow {site} to open {scheme} links" choice on the #30490 browser prompt, saved per site and scheme. That remembered choice stays out of this PR. The first terminal fix is still a prompt on every click, and it still waits on a maintainer picking the dedicated IPC (option 1) rather than widening shell:openUrl.

This branch has not been deployed

No deployments
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.

7 participants