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
[Bug]: Clicking to focus the terminal opens log output in the editor as a file path #15757
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Run a link-heavy process in the integrated terminal. A Next.js dev server with tRPC is a good example: it logs a request line per call, such as GET /api/trpc/post.list,user.me?batch=1&input=%7B%220%22%3A... 200 in 34ms.
Make the terminal narrow so those request lines wrap across several rows.
Move focus elsewhere (the composer, for example).
Click anywhere in the terminal output to focus it, then press Ctrl+C to stop the server.
Expected behavior
The click focuses the terminal and Ctrl+C stops the process. Nothing opens.
Actual behavior
The focus click frequently opens the preferred editor (VS Code here) on a path that is not a file, such as /api/trpc/post.list,user.me?batch=1&input=.... It looks like Ctrl+C caused it, but the click did.
From reading the code at main @ 18b21325c3:
Since fix(web): honor terminal link browser overrides #10060, an unmodified single left click on a detected terminal link activates it (onPointerDown / onPointerUp in apps/web/src/terminal/ghostty/surface.ts). Before that PR it required Ctrl/Cmd.
FILE_PATH_PATTERN in apps/web/src/terminal-links.ts treats any token starting with /, and any word/word token, as a path. A logged request route like /api/trpc/...?batch=1&input=... matches in full, query string included.
Path links go straight to openInPreferredEditor from handleLinkActivate in apps/web/src/components/ThreadTerminalDrawer.tsx, with no check that the file exists.
A wrapped link is one hit target across all of its rows, so a long tRPC URL at narrow width can cover most of the visible terminal.
Together these leave very little terminal area that is safe to click for focus while such a server is running.
Linux, VS Code as preferred editor, Next.js dev server with tRPC in the integrated terminal
Workaround
Shift+click to focus (Shift never activates a link), click on blank space, or drag slightly before releasing. There is no setting that disables plain-click activation for paths; "Open links in" only affects URLs.
Possible directions
Leaving the choice to maintainers, but the options I can see:
Require Ctrl/Cmd for path links again and keep plain click for URLs.
Do not activate a link on the click that gives the terminal focus.
Tighten path detection, for example by not treating tokens with a query string as paths, or by checking the file exists before opening the editor.
Before submitting
Area
apps/web
Steps to reproduce
GET /api/trpc/post.list,user.me?batch=1&input=%7B%220%22%3A... 200 in 34ms.Expected behavior
The click focuses the terminal and Ctrl+C stops the process. Nothing opens.
Actual behavior
The focus click frequently opens the preferred editor (VS Code here) on a path that is not a file, such as
/api/trpc/post.list,user.me?batch=1&input=.... It looks like Ctrl+C caused it, but the click did.From reading the code at
main @ 18b21325c3:onPointerDown/onPointerUpinapps/web/src/terminal/ghostty/surface.ts). Before that PR it required Ctrl/Cmd.FILE_PATH_PATTERNinapps/web/src/terminal-links.tstreats any token starting with/, and anyword/wordtoken, as a path. A logged request route like/api/trpc/...?batch=1&input=...matches in full, query string included.openInPreferredEditorfromhandleLinkActivateinapps/web/src/components/ThreadTerminalDrawer.tsx, with no check that the file exists.Together these leave very little terminal area that is safe to click for focus while such a server is running.
Impact
Minor bug or occasional failure
Version or commit
main @ 18b2132
Environment
Linux, VS Code as preferred editor, Next.js dev server with tRPC in the integrated terminal
Workaround
Shift+click to focus (Shift never activates a link), click on blank space, or drag slightly before releasing. There is no setting that disables plain-click activation for paths; "Open links in" only affects URLs.
Possible directions
Leaving the choice to maintainers, but the options I can see: