You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Setting for clicking file paths in the integrated terminal (a plain click currently always opens the external editor, e.g. Cursor)
#25635
In the integrated terminal, a plain single click on anything detected as a file path opens it in the external "preferred editor" right away. On macOS with Cursor installed, that's Cursor, even if you never chose an editor, because cursor is first in the default EDITORS list (packages/contracts/src/editor.ts:17).
This is easy to trigger by accident:
Run pwd and click the output, or click the terminal just to focus it or place the cursor. The whole folder opens in a new Cursor window.
Click a path in git status, ls, a stack trace or compiler output while reading it. The editor jumps to the front.
Holding ⌘/Ctrl doesn't change anything for paths, because the path branch ignores modifiers. The only ways to click a path without opening the editor are Shift+click or dragging.
Real detector output on main @ 8e1bb037 (extractTerminalLinks, apps/web/src/terminal-links.ts):
Terminal line
Detected link
/Users/me/Developer/my-app (plain pwd output)
path → /Users/me/Developer/my-app
~/Developer/my-app
path → ~/Developer/my-app
src/components/App.tsx:42:7 error Unexpected any
path → src/components/App.tsx:42:7
modified: apps/web/src/main.ts
path → apps/web/src/main.ts
Local: http://localhost:5173/
url → http://localhost:5173/
Every path row opens the external editor on a single unmodified click.
Is this intended? (history)
Yes, but it wasn't designed as a choice for file paths, and it isn't documented:
The original terminal links (ccaa58e393, Feb 2026) required ⌘-click on macOS and Ctrl-click elsewhere. A plain click did nothing (if (!isTerminalLinkActivation(event)) return;). This matches VS Code's terminal, iTerm2 and Ghostty.
fix(web): honor terminal link browser overrides #10060 ("honor terminal link browser overrides") removed the modifier for all terminal links. Its stated reason was only about URLs: "Terminal links only activated with Ctrl/Cmd, and that modifier could not override an in-app browser preference on Windows." File paths and the external editor aren't mentioned. Plain-click-opens-editor for paths came along with that change.
It isn't documented. The only related setting, Settings → Integrations → Open links in, says "Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way." That applies to http(s) URLs only, not paths.
There's no setting to turn it off or require a modifier.
Add a setting for what clicking a file path in the integrated terminal does, next to "Open links in" (Settings → Integrations). For example, "Terminal file paths":
Option
Plain click
⌘/Ctrl+click
Open in editor (today's behavior; could stay the default)
preferred editor
preferred editor
Require ⌘/Ctrl
nothing (focus/select only)
preferred editor
Open in T3 Code
in-app file viewer, or reveal in the Files panel for directories
preferred editor (same as chat file links)
Off
nothing
nothing
Small related improvements:
Show the shortcut in the link's hover tooltip ("⌘-click to open in Cursor"), like other terminals do.
Consider not opening directories (like pwd output) in the external editor on a plain click, even in the default mode. Opening a whole new editor window is much more disruptive than opening a file.
Implementation pointers (main @ 8e1bb037)
apps/web/src/components/ThreadTerminalDrawer.tsx:969-1015: handleLinkActivate. URLs already branch on event.metaKey || event.ctrlKey (forceBrowser), and paths go straight to openTerminalPath → openInPreferredEditor (:1003-1014). This is where the new setting and the modifier check belong.
apps/web/src/terminal-links.ts:175-183: isTerminalLinkActivation, the original platform-aware ⌘/Ctrl check, still exported (now used only by markdown-links.ts). It can be reused.
apps/web/src/terminal/ghostty/surface.ts:1324-1339, 1564-1577: plain-click link activation on pointer down/up. It can stay as it is if the drawer decides what to do. With "Off", canActivateLink (surface.ts:2020-2023) could return false for paths, so they don't show a hover underline or pointer.
packages/contracts/src/settings.ts:259-261, 346: BrowserLinkTarget / browserLinkTarget, a pattern to copy for the new client setting.
apps/web/src/components/settings/IntegrationsSettings.tsx:~644: the "Open links in" row. Put the new row next to it, and fix that description so it doesn't suggest it covers terminal paths.
apps/web/src/editorPreferences.ts:47-65: the preferred editor is the last one picked in "Open in", or else the first installed entry in EDITORS.
Steps to see the current behavior
Install Cursor (or any supported editor), open a thread, and open the integrated terminal.
Run pwd.
Click once on the printed path. The folder opens in a new Cursor window.
⌘-click (Ctrl-click) it instead. Same result.
Related
#10060 (removed the modifier), #15757 / #15838 (focus click opened the editor; detection narrowed), #11403 (configurable default action for file links in chat, diffs and the file browser; closed). This request covers the terminal surface, which #11403 didn't.
Version
Behavior present since #10060 (Sep 2026). Confirmed in source on main @ 8e1bb037 and seen on desktop v0.1.2 (macOS, Cursor installed).
Contributions welcome
This is open for anyone who wants to pick it up. The relevant code paths and a suggested design are above. If you'd like to take it, leave a comment so we don't double up, and feel free to ask questions on the issue.
This discussion was converted from issue #25589 on October 26, 2026 21:35.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Area
apps/web
Problem
In the integrated terminal, a plain single click on anything detected as a file path opens it in the external "preferred editor" right away. On macOS with Cursor installed, that's Cursor, even if you never chose an editor, because
cursoris first in the defaultEDITORSlist (packages/contracts/src/editor.ts:17).This is easy to trigger by accident:
pwdand click the output, or click the terminal just to focus it or place the cursor. The whole folder opens in a new Cursor window.git status,ls, a stack trace or compiler output while reading it. The editor jumps to the front.Real detector output on
main @ 8e1bb037(extractTerminalLinks,apps/web/src/terminal-links.ts):/Users/me/Developer/my-app(plainpwdoutput)path→/Users/me/Developer/my-app~/Developer/my-apppath→~/Developer/my-appsrc/components/App.tsx:42:7 error Unexpected anypath→src/components/App.tsx:42:7modified: apps/web/src/main.tspath→apps/web/src/main.tsLocal: http://localhost:5173/url→http://localhost:5173/Every
pathrow opens the external editor on a single unmodified click.Is this intended? (history)
Yes, but it wasn't designed as a choice for file paths, and it isn't documented:
ccaa58e393, Feb 2026) required ⌘-click on macOS and Ctrl-click elsewhere. A plain click did nothing (if (!isTerminalLinkActivation(event)) return;). This matches VS Code's terminal, iTerm2 and Ghostty.So the behavior is deliberate, but:
http(s)URLs only, not paths.Proposed solution
Add a setting for what clicking a file path in the integrated terminal does, next to "Open links in" (Settings → Integrations). For example, "Terminal file paths":
Small related improvements:
pwdoutput) in the external editor on a plain click, even in the default mode. Opening a whole new editor window is much more disruptive than opening a file.Implementation pointers (
main @ 8e1bb037)apps/web/src/components/ThreadTerminalDrawer.tsx:969-1015:handleLinkActivate. URLs already branch onevent.metaKey || event.ctrlKey(forceBrowser), and paths go straight toopenTerminalPath→openInPreferredEditor(:1003-1014). This is where the new setting and the modifier check belong.apps/web/src/terminal-links.ts:175-183:isTerminalLinkActivation, the original platform-aware ⌘/Ctrl check, still exported (now used only bymarkdown-links.ts). It can be reused.apps/web/src/terminal/ghostty/surface.ts:1324-1339, 1564-1577: plain-click link activation on pointer down/up. It can stay as it is if the drawer decides what to do. With "Off",canActivateLink(surface.ts:2020-2023) could return false for paths, so they don't show a hover underline or pointer.packages/contracts/src/settings.ts:259-261, 346:BrowserLinkTarget/browserLinkTarget, a pattern to copy for the new client setting.apps/web/src/components/settings/IntegrationsSettings.tsx:~644: the "Open links in" row. Put the new row next to it, and fix that description so it doesn't suggest it covers terminal paths.apps/web/src/editorPreferences.ts:47-65: the preferred editor is the last one picked in "Open in", or else the first installed entry inEDITORS.Steps to see the current behavior
pwd.Related
#10060 (removed the modifier), #15757 / #15838 (focus click opened the editor; detection narrowed), #11403 (configurable default action for file links in chat, diffs and the file browser; closed). This request covers the terminal surface, which #11403 didn't.
Version
Behavior present since #10060 (Sep 2026). Confirmed in source on
main @ 8e1bb037and seen on desktop v0.1.2 (macOS, Cursor installed).Contributions welcome
This is open for anyone who wants to pick it up. The relevant code paths and a suggested design are above. If you'd like to take it, leave a comment so we don't double up, and feel free to ask questions on the issue.
All reactions