github / github/copilot-cli

Nerd Font / PUA Unicode glyphs (U+E000-F8FF) are invisible in CLI output

Aberta
#3,004 0 comentários 0 reações 0 responsáveis Ver no GitHub
area:terminal-rendering
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

### Describe the bug

Nerd Font glyphs (Unicode Private Use Area characters, U+E000-U+F8FF) are invisible in Copilot CLI output — both in LLM text responses and in captured shell command output. The same glyphs render correctly when the identical script is run directly in the terminal outside the CLI.

This is likely related to the same Ink/string-width rendering pipeline issue as #2521 (Thai text truncation) and #681 (Unicode character handling).

### Root cause analysis

I traced the rendering pipeline in `app.js`:

1. **`Hxn` (hidden_characters filter):** Does NOT strip PUA chars — only strips bidi/tag/invisible Unicode. **Not the culprit.**
2. **`Qa` (string-width function):** Correctly returns width=1 for PUA codepoints. Confirmed via Node.js testing that PUA chars are not matched by `\p{Default_Ignorable_Code_Point}` and pass all skip conditions. **Not the culprit.**
3. **`Cht` → `Rht` → `wht` (Ink Output grid rendering):** Characters are parsed by `Intl.Segmenter`, placed in a grid via `M0e.get()`, and re-rendered to ANSI output. PUA characters appear to be lost during this pipeline — they get width=1 allocation but their actual character value doesn't survive the re-render to terminal output.
4. **Console codepage (CP437 vs 65001):** Tested with `chcp 65001` — no change. **Not the culprit.**

The chars are present in the data but invisible in the rendered output. Similar to #2521 where Thai text is "complete if copied but truncated on screen."

### Affected version

GitHub Copilot CLI 1.0.10

### Steps to reproduce

1. Install a Nerd Font (e.g., UbuntuMono Nerd Font) and set it as the terminal font
2. Verify glyphs work outside CLI:
```powershell
# Save as test.ps1 and run directly — glyphs appear
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
Write-Host 'Standard: ' -NoNewline; Write-Host ([char]0x2500 + ' ' + [char]0x2502)
Write-Host 'Nerd Font: ' -NoNewline; Write-Host ([char]0xE0B0 + ' ' + [char]0xE702 + ' ' + [char]0xF135)
```
3. Start Copilot CLI (`copilot`)
4. Ask Copilot to run the same script — the Nerd Font line shows blanks
5. Ask Copilot to include PUA characters in its text response — also invisible

### Expected behavior

Nerd Font PUA glyphs should render correctly when:
- The terminal font supports them (confirmed by running the script directly)
- The CLI's shell tool captures and re-displays command output containing PUA chars
- The LLM response contains PUA characters in text

### Actual behavior

- Standard Unicode (box drawing, arrows, emoji) renders correctly
- PUA characters (U+E000–U+F8FF) used by Nerd Fonts are invisible
- The characters are technically "there" (width is allocated) but visually absent

### Environment

- OS: Windows 11
- Terminal: Windows Terminal with Nerd Font
- Console codepage: Tested with both CP437 and CP65001
- Node.js: v24+
- Binary: `copilot-win32-x64/copilot.exe`

### Additional context

This affects anyone using Nerd Fonts for terminal theming (starship, oh-my-posh, powerlevel10k users). The PUA codepoint ranges used by Nerd Fonts:

| Icon Set | Range |
|----------|-------|
| Seti-UI + Custom | U+E5FA - U+E6B8 |
| Devicons | U+E700 - U+E8CF |
| Powerline | U+E0A0 - U+E0D4 |
| Font Awesome | U+F000 - U+F2E0 |
| Octicons | U+F400 - U+F532 |
| Codicons | U+EA60 - U+EC1E |
| Weather Icons | U+E300 - U+E3E3 |

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start in app.js around the Hxn, Qa, and Cht/Rht/wht rendering pipeline described in the report, then run the provided PowerShell reproduction in Windows Terminal. Compare captured shell output and LLM text containing U+E000–F8FF with direct terminal output. Done means supported Nerd Font PUA glyphs remain visible in both CLI output paths without breaking standard Unicode rendering.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
node.js
Domínio
cli
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
52/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.