Wrapped links leak OSC 8 escape markup in Ghostty
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
Long links in assistant Markdown sometimes render with the OSC 8 hyperlink control payload visible as text when the link wraps in Ghostty. The output is prefixed with text resembling:
]8;;id=md-<generated-id>;https://example.com/a/very/long/path/https://example.com/a/very/long/path/
The saved assistant response contains only a valid plain URL, with no malformed Markdown or escape sequences. This indicates the corruption occurs in Copilot CLI's terminal rendering rather than in model output.
This appears related to the 1.0.68 changelog fix, "Preserve wrapped OSC 8 hyperlink IDs in terminal output," but still reproduces on 1.0.78.
Affected version
GitHub Copilot CLI 1.0.78
Steps to reproduce the behavior
- Launch Copilot CLI in Ghostty.
- Have an assistant response end with a bare URL long enough to wrap at the current terminal width.
- Observe that the URL is preceded by visible OSC 8 payload text such as
]8;;id=md-...;and may appear duplicated.
An affected session is:
250a0930-cde5-4f39-bcdd-c40ef05656a0
The problem is visible in the final assistant response of that session.
Expected behavior
The response should display one clean, clickable URL. OSC 8 control sequences and generated hyperlink IDs must never be visible, including when the URL wraps across terminal lines.
Additional context
- Operating system: macOS (Darwin), Apple Silicon
- Terminal: Ghostty
1.3.2-main-+8252871b2 - Environment:
TERM_PROGRAM=ghostty,TERM=xterm-ghostty,COLORTERM=truecolor - Workaround: launching with
FORCE_HYPERLINK=0 copilotprevents OSC 8 hyperlinks from being emitted - The local session event log records the assistant content as normal prose followed by a plain URL, confirming the malformed text is introduced during rendering
- Screenshot exists locally but was not attached because
gh issue createdoes not support uploading issue-form attachments
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 Ghostty 中运行 Copilot CLI 1.0.78,使用一个会换行的长纯 URL,并以会话 250a0930-cde5-4f39-bcdd-c40ef05656a0 作为上下文来复现该问题。将会话事件日志中的纯 URL 与终端输出进行比较,并跟踪 OSC 8 的渲染路径;当换行的链接显示为一个干净的可点击 URL,且没有可见的控制 payload 或重复文本时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100