Skip to content

feat(browser): add Cmd+Shift+Click to toggle terminal link destination#1470

Open
dortort wants to merge 1 commit into
manaflow-ai:mainfrom
dortort:feat/cmd-shift-link-toggle
Open

feat(browser): add Cmd+Shift+Click to toggle terminal link destination#1470
dortort wants to merge 1 commit into
manaflow-ai:mainfrom
dortort:feat/cmd-shift-link-toggle

Conversation

@dortort
Copy link
Copy Markdown

@dortort dortort commented Mar 15, 2026

Summary

Implements the feature requested in #719 (comment):

  • Cmd+Click opens links using the default destination (per the "Open Terminal Links in cmux Browser" setting)
  • Cmd+Shift+Click opens in the opposite browser, giving quick access to both without changing the setting
Setting Cmd+Click Cmd+Shift+Click
ON (cmux browser) cmux browser system browser
OFF (system browser) system browser cmux browser

Changes

Ghostty submodule (manaflow-ai/ghostty#13)

  • Strip shift modifier in linkAtPos() so Cmd+Shift activates links the same as Cmd
  • Strip shift in renderer for both OSC8 and regex link highlighting so hover underlines appear with Cmd+Shift
  • Invalidate link_point cache in modsChanged() so cursor shape updates when mods change

Swift (Sources/GhosttyTerminalView.swift)

  • Read shift state in OPEN_URL handler and XOR with the setting to determine browser destination

Settings (Sources/cmuxApp.swift, Resources/Localizable.xcstrings)

  • Updated subtitle to: "Sets the default for Cmd+Click. Cmd+Shift+Click opens in the other browser."
  • Updated all 17 language translations (marked needs_review)

Dependencies

Ghostty submodule PR must merge first: manaflow-ai/ghostty#13

Test plan

  • Hover Cmd over a URL → underline appears, pointer cursor
  • Hover Cmd+Shift over a URL → underline appears, pointer cursor
  • Cmd+Click → opens in default browser (per setting)
  • Cmd+Shift+Click → opens in opposite browser
  • Toggle setting OFF → verify behaviors swap
  • Check Settings > Browser for updated subtitle text
  • Host whitelist still applies when routing to cmux browser

Demo

Screen.Recording.2026-03-15.at.1.47.34.PM.mov

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Shift-key modifier lets you toggle whether terminal links open in the embedded or external browser.
  • Documentation

    • Clarified keyboard shortcut descriptions for terminal link behavior.
    • Expanded and updated localized UI text: update notifications, security prompts, workspace/tab controls, preferences, and miscellaneous labels across languages.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 15, 2026

@dortort is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05737567-4443-4110-9e28-317b3c610964

📥 Commits

Reviewing files that changed from the base of the PR and between 49bc422 and f1c37fb.

📒 Files selected for processing (4)
  • Resources/Localizable.xcstrings
  • Sources/GhosttyTerminalView.swift
  • Sources/cmuxApp.swift
  • ghostty
🚧 Files skipped from review as they are similar to previous changes (1)
  • ghostty

📝 Walkthrough

Walkthrough

Adds extensive localization updates, makes terminal link opening respect the Shift modifier combined with the user setting to choose embedded vs external browser, updates a settings subtitle, and advances the ghostty submodule pointer.

Changes

Cohort / File(s) Summary
Localization
Resources/Localizable.xcstrings
Added and revised many localized UI strings: updates/notifications, security warnings, settings labels/subtitles, workspace/menu copy, dialogs, tooltips, and status/error messages.
Terminal Link Handling
Sources/GhosttyTerminalView.swift
Link-opening logic now reads the current Shift key state, combines it with openTerminalLinksInCmuxBrowser to compute useCmuxBrowser, and branches to embedded cmux browser or external browser; added debug logging.
Settings UI Text
Sources/cmuxApp.swift
Updated subtitle for settings.browser.openTerminalLinks to explain Cmd+Click default and Cmd+Shift+Click behavior.
Submodule
ghostty
Updated ghostty submodule reference to a newer commit.

Sequence Diagram(s)

sequenceDiagram
    participant User as User (Keyboard/Mouse)
    participant TerminalView as TerminalView
    participant Settings as Settings (openTerminalLinksInCmuxBrowser)
    participant CmuxBrowser as CmuxBrowser (embedded)
    participant SystemBrowser as SystemBrowser (external)

    User->>TerminalView: Click link (may hold Shift)
    TerminalView->>User: read modifier state (Shift)
    TerminalView->>Settings: read openTerminalLinksInCmuxBrowser
    TerminalView->>TerminalView: compute useCmuxBrowser = (ShiftHeld XOR setting)
    alt useCmuxBrowser == true
        TerminalView->>CmuxBrowser: open URL (embedded)
    else
        TerminalView->>SystemBrowser: open URL (external)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 I tapped Shift once, the link took flight,
Embedded or external — a hop of light.
Strings polished neatly, locales hum along,
A rabbit’s small cheer for clicks and song. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main feature addition: enabling Cmd+Shift+Click to toggle terminal link destinations between the two browser options.
Description check ✅ Passed The description comprehensively covers the feature, changes across multiple files, dependencies, test plan, and includes a demo video, aligning well with the template structure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="ghostty">

<violation number="1" location="ghostty:1">
P1: This submodule pointer references a Ghostty commit that is not yet available on an accessible remote, which will break CI and fresh checkouts when resolving submodules.</violation>
</file>

<file name="Resources/Localizable.xcstrings">

<violation number="1" location="Resources/Localizable.xcstrings:51355">
P3: Fix the Polish translation grammar: "w drugim przeglądarce" is incorrect and should use a grammatically correct phrase (e.g., "w innej przeglądarce").</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread ghostty Outdated
Comment thread Resources/Localizable.xcstrings Outdated
"state": "translated",
"value": "Po wyłączeniu linki kliknięte w terminalu otwierają się w domyślnej przeglądarce."
"state": "needs_review",
"value": "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugim przeglądarce."
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 15, 2026

Choose a reason for hiding this comment

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

P3: Fix the Polish translation grammar: "w drugim przeglądarce" is incorrect and should use a grammatically correct phrase (e.g., "w innej przeglądarce").

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Resources/Localizable.xcstrings, line 51355:

<comment>Fix the Polish translation grammar: "w drugim przeglądarce" is incorrect and should use a grammatically correct phrase (e.g., "w innej przeglądarce").</comment>

<file context>
@@ -51292,109 +51292,109 @@
-            "state": "translated",
-            "value": "Po wyłączeniu linki kliknięte w terminalu otwierają się w domyślnej przeglądarce."
+            "state": "needs_review",
+            "value": "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugim przeglądarce."
           }
         },
</file context>
Fix with Cubic

@dortort dortort force-pushed the feat/cmd-shift-link-toggle branch from 4083008 to 49bc422 Compare March 15, 2026 18:02
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ghostty`:
- Line 1: The parent repo's submodule pointer references commit
068064f06be42c7ba5000171178fde43559a0c9e which is not reachable by CI; push that
exact commit to the manaflow-ai/ghostty remote (or the branch you use for
submodules) first so the SHA is resolvable, then update the parent repo's
submodule pointer (the gitlink) to that commit and re-run CI to verify ancestry;
in future, always push the submodule commit to its remote before committing the
updated pointer in the parent repository.

In `@Resources/Localizable.xcstrings`:
- Around line 51354-51355: The Polish subtitle text uses the incorrect phrase "w
drugim przeglądarce," which is grammatically wrong. Update the phrase to the
correct declension "w drugiej przeglądarce" to ensure proper Polish grammar and
natural reading in the UI text. Locate this fix in the subtitle value string in
the resources file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 714acb3d-7c87-403d-8bb5-6860fb982654

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb2816 and 4083008.

📒 Files selected for processing (4)
  • Resources/Localizable.xcstrings
  • Sources/GhosttyTerminalView.swift
  • Sources/cmuxApp.swift
  • ghostty

Comment thread ghostty Outdated
@@ -1 +1 @@
Subproject commit bc9be90a21997a4e5f06bf15ae2ec0f937c2dc42
Subproject commit 068064f06be42c7ba5000171178fde43559a0c9e
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Blocker: submodule SHA must be reachable by CI before merging

The parent repo now references 068064f06be42c7ba5000171178fde43559a0c9e, but this SHA is currently not resolvable by CI (as noted in the PR summary). Please push this exact commit to the manaflow-ai/ghostty fork/branch first, then keep this pointer update.

Based on learnings: When modifying a submodule, push the submodule commit to its remote branch before committing the updated pointer in the parent repo, and verify ancestry from the submodule remote.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ghostty` at line 1, The parent repo's submodule pointer references commit
068064f06be42c7ba5000171178fde43559a0c9e which is not reachable by CI; push that
exact commit to the manaflow-ai/ghostty remote (or the branch you use for
submodules) first so the SHA is resolvable, then update the parent repo's
submodule pointer (the gitlink) to that commit and re-run CI to verify ancestry;
in future, always push the submodule commit to its remote before committing the
updated pointer in the parent repository.

Comment thread Resources/Localizable.xcstrings Outdated
Cmd+Click opens links using the default destination per the "Open
Terminal Links in cmux Browser" setting. Cmd+Shift+Click opens in the
opposite browser, giving users quick access to both without changing
the setting.

- Read shift state in OPEN_URL handler and XOR with setting
- Update setting subtitle to explain the Cmd+Shift shortcut
- Update all xcstrings translations (marked needs_review)
- Update ghostty submodule for shift-aware link detection

Closes manaflow-ai#719

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dortort dortort force-pushed the feat/cmd-shift-link-toggle branch from 49bc422 to f1c37fb Compare March 15, 2026 18:05
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
Resources/Localizable.xcstrings (1)

51354-51355: ⚠️ Potential issue | 🟡 Minor

Fix the Polish declension in this subtitle.

Line 51355 still uses w drugim przeglądarce, which is ungrammatical in Polish and will read awkwardly in Settings.

✏️ Suggested fix
-            "value": "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugim przeglądarce."
+            "value": "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugiej przeglądarce."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Resources/Localizable.xcstrings` around lines 51354 - 51355, Update the
Polish subtitle value in Resources/Localizable.xcstrings by correcting the
declension “w drugim przeglądarce” to the grammatically correct form “w drugiej
przeglądarce” in the string value "Ustawia domyślną akcję Cmd+Klik.
Cmd+Shift+Klik otwiera w drugim przeglądarze." so it reads "Ustawia domyślną
akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugiej przeglądarce."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@Resources/Localizable.xcstrings`:
- Around line 51354-51355: Update the Polish subtitle value in
Resources/Localizable.xcstrings by correcting the declension “w drugim
przeglądarce” to the grammatically correct form “w drugiej przeglądarce” in the
string value "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik otwiera w drugim
przeglądarze." so it reads "Ustawia domyślną akcję Cmd+Klik. Cmd+Shift+Klik
otwiera w drugiej przeglądarce."

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e956150-5888-45de-9401-fd2bef60a44b

📥 Commits

Reviewing files that changed from the base of the PR and between 4083008 and 49bc422.

📒 Files selected for processing (4)
  • Resources/Localizable.xcstrings
  • Sources/GhosttyTerminalView.swift
  • Sources/cmuxApp.swift
  • ghostty
🚧 Files skipped from review as they are similar to previous changes (2)
  • Sources/cmuxApp.swift
  • ghostty

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.

1 participant