fix(terminal): 修复 OSC 8 链接打开失败 - #452
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
修复 Codex 终端中部分链接弹出安全警告后仍无法正常打开的问题。
Codex 输出的 OSC 8 超链接此前由 xterm.js 默认处理:点击时显示安全确认,并通过
window.open()打开。该路径在 Electron 中不能可靠交给系统浏览器;普通文本 URL 则通过 Electronshell.openExternal打开,因此两类链接的行为不一致。变更
shell.openExternal。验证
pnpm test -- src/renderer/hooks/__tests__/useXtermConptyDisplay.test.ts:3/3 通过pnpm typecheck:通过pnpm build:通过pnpm test:已执行的 208 个测试全部通过;PtyManagerWindowsHelper.test.ts因本地 Electron 二进制缺失而无法加载,两次重新下载均被网络ECONNRESET中断