github / github/copilot-cli

Support OSC 8 terminal hyperlinks in MCP progress notification messages

未关闭
#1,837 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:mcp
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

## Summary

MCP servers can send progress notifications (
otifications/progress) with a message field that gets displayed in the Copilot CLI status line. It would be great if the CLI could pass through [OSC 8 terminal hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) embedded in these messages, so MCP servers can include clickable links (e.g., to a PR URL).

## Current Behavior

The CLI strips or does not render ANSI/OSC escape sequences in the `message` field of `notifications/progress`. The text content displays correctly, but any embedded OSC 8 hyperlink sequences are lost.

## Desired Behavior

When rendering MCP progress messages in the status line or timeline, detect whether the hosting terminal supports OSC 8 hyperlinks and pass them through if supported. For unknown or unsupported terminals, strip the escape sequences cleanly so only the plain display text remains (no garbled output).

**Terminal detection could use environment variables:**
- `WT_SESSION` — Windows Terminal
- `TERM_PROGRAM=iTerm.app` — iTerm2
- `TERM_PROGRAM=WezTerm` — WezTerm
- `TERM_PROGRAM=vscode` — VS Code integrated terminal
- `KITTY_WINDOW_ID` — Kitty

## Use Case

Our MCP server ([pr-copilot](https://github.com/m-nash/pr-copilot)) monitors PRs during long-running polling operations. We send periodic heartbeat progress notifications like:

`🕐 7:15:30 PM · Background Monitoring PR #56791 · CI: 43✅ · Will prompt when your attention is needed`

Being able to make `PR #56791` a clickable link to the GitHub PR would improve the user experience significantly.

## Context

- Copilot CLI v0.0.389 added "Display progress messages from MCP tools in timeline" — this feature works great
- We send `notifications/progress` with a self-generated `progressToken` since the CLI doesn't send one in tool call `_meta`
- The progress messages display correctly in the status line, but without hyperlink support

---
🤖 m-nash-copilot

贡献指南

打开贡献指南

调研方向

Start at the notifications/progress handling and the status line or timeline rendering path mentioned in the issue. Trace how the message field is currently sanitized, then verify supported terminals preserve OSC 8 links while unsupported terminals show clean plain text; add or run focused rendering tests if the project provides them.

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。