github / github/copilot-cli

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

Abierto
#3,536 1 comentario 2 reacciones 0 asignados Ver en GitHub
area:platform-windows area:terminal-rendering
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
powershell
Área
cli
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.