github / github/copilot-cli

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

Đang mở
#3,536 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:platform-windows area:terminal-rendering
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.