github / github/copilot-cli

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

Aperta
#3,536 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
area:platform-windows area:terminal-rendering
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.