github / github/copilot-cli

CJK characters visually overlapped/dropped in input box on Windows (buffer is correct, display bug only)

Aberta
#3,536 1 comentário 2 reações 0 responsáveis Ver no GitHub
area:platform-windows 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

In the Windows Terminal, when a prompt containing mixed Chinese (CJK) and English characters is submitted, the **submitted prompt header / bubble drops or visually overlaps CJK characters**, even though the same text renders correctly in the input box.

Concretely, I typed:

```
Copilot CLI如何提issue
```

- The **input field** (bottom prompt area) displayed the text correctly: `Copilot CLI如何提issue` / `Copilot CLI怎么提issue`.
Image

- The **submitted-prompt header bubble** displayed it as: `Copilot CLI 何 提issue` — the characters `如何` collapsed to just `何` plus stray whitespace, and the right border of the box clipped/overlapped the glyphs.

Note: after enter, the message is correctly passed to the CLI. But display message during type is incorrect.

This looks like a CJK East-Asian-Width miscalculation: each CJK character is rendered by the terminal as 2 columns wide, but the renderer for the header bubble appears to allocate only 1 column, so adjacent glyphs are overwritten/clipped by the next character or the box border.

This may share a root cause with #2825 (CJK text wrapping error), but the visible symptom is different — there it's wrapping in the input; here it's characters being silently dropped/overlapped in the displayed (already-submitted) prompt.

### Affected version

GitHub Copilot CLI `1.0.55-3` on Windows (Windows Terminal, PowerShell 7).

### Steps to reproduce the behavior

1. Launch `copilot` in Windows Terminal.
2. Enable autopilot mode (`Shift+Tab` until "Autopilot mode enabled with all permissions.").
3. Type a prompt containing mixed CJK + ASCII, e.g. `Copilot CLI如何提issue`.
4. Press Enter to submit.
5. Observe the rendered prompt bubble/header at the top of the response.

### Expected behavior

The submitted-prompt header should render the prompt exactly as typed, with CJK characters preserved and no overlap/clipping. CJK characters should be treated as 2 terminal columns wide for layout purposes.

### Actual behavior

CJK characters in the submitted prompt header are dropped/overlapped (e.g. `如何` → `何 `). The input area itself renders correctly, so the bug appears to be specific to the prompt-bubble renderer's width calculation.

### Additional context

- OS: Windows 11
- Terminal: Windows Terminal
- Shell: PowerShell 7
- Font: default Windows Terminal font (Cascadia Mono)
- Locale: zh-CN / en-US mixed
- Related: #2825 (CJK text wrapping), #3045 (IME flicker), #3097 (paste corruption)

Screenshots (will attach via web UI):
- Image 1: submitted-prompt header showing dropped/overlapped CJK characters.
- Image 2: input-field showing the same prompt rendering correctly.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Reproduce the mixed CJK and ASCII prompt in Windows Terminal, then locate the submitted-prompt header or bubble renderer and compare its width calculation with the input field that renders correctly. Verify the terminal-column width assigned to CJK characters and confirm that the submitted header preserves every character without overlap or clipping.

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

Avaliação

Stack de tecnologia
powershell
Domínio
cli
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 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.