Wrapped links leak OSC 8 escape markup in Ghostty
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
### 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:
```text
]8;;id=md-;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
```text
GitHub Copilot CLI 1.0.78
```
### Steps to reproduce the behavior
1. Launch Copilot CLI in Ghostty.
2. Have an assistant response end with a bare URL long enough to wrap at the current terminal width.
3. 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:
```text
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 copilot` prevents 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 create` does not support uploading issue-form attachments
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Riproduci il problema eseguendo Copilot CLI 1.0.78 in Ghostty con un lungo URL semplice che va a capo, usando la sessione 250a0930-cde5-4f39-bcdd-c40ef05656a0 come contesto. Confronta l’URL semplice nel registro degli eventi della sessione con l’output del terminale e traccia il percorso di rendering di OSC 8; il lavoro è completato quando i link che vanno a capo vengono visualizzati come un unico URL pulito e cliccabile, senza payload di controllo visibili né testo duplicato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100