[BUG] Vietnamese IME input doubles characters on Windows (\x08 BS not handled, only \x7F DEL)

Resolved 💬 3 comments Opened Mar 13, 2026 by potpet07 Closed Mar 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

What's Wrong?

When typing Vietnamese using Telex/VNI IME on Windows, characters are doubled/garbled in the Claude Code CLI prompt. The old character is not deleted before the accented replacement is inserted.

Examples:
| Typed | Expected | Actual |
|-------|----------|--------|
| tiếng | tiếng | tieêếng |
| việt | việt | viêệt |
| được | được | đươợc |
| đang | đang | dđang |

This affects all Vietnamese IME methods on Windows (built-in Windows Telex, UniKey, EVKey, etc.).

Environment

  • OS: Windows 11 (10.0.26200)
  • Claude Code: v2.1.74 (npm) / VSCode extension
  • Node.js: v22.14.0
  • IME: Windows built-in Vietnamese Telex, UniKey — all produce the same bug

Root Cause Analysis

How Vietnamese IME works

Vietnamese IME composes characters by sending a backspace to delete the previous character, then the new accented character. For example, typing "việt" via Telex (keystrokes: v-i-e-e-j-t):

v    → 0x76              (insert 'v')
i    → 0x69              (insert 'i')
e    → 0x65              (insert 'e')
e    → 0x08 + 0xC3 0xAA  (BS to delete 'e', then insert 'ê')
j    → 0x08 + 0xE1 0xBB 0x87  (BS to delete 'ê', then insert 'ệ')
t    → 0x74              (insert 't')

The platform difference (core issue)

| Platform | IME Backspace char | Code point |
|----------|--------------------|------------|
| macOS / Linux | \x7F (DEL) | 127 |
| Windows | \x08 (BS) | 8 |

Claude Code's TextInput handler only recognizes \x7F (DEL) for IME backspace — the character used on macOS/Linux. On Windows, the IME sends \x08 (BS), which the handler does not treat as backspace. The old character is never deleted, and the accented replacement is appended on top of it.

Why it's intermittent

Raw stdin captures show two timing patterns:

Pattern A — BS and replacement arrive together (causes bug):

{len:2, codes:[8, 234]}       // \x08 + 'ê' in one read
{len:4, codes:[8,8,233,110]}  // 2×\x08 + "én" in one read

The tokenizer does not split \x08 out of mixed data → backspace=false, text includes invisible BS char → handler inserts garbage.

What Should Happen?

Vietnamese text typed via IME (Telex/VNI) should render correctly in the Claude Code CLI prompt. For example, typing "tiếng việt" should display "tiếng việt", not "tieêếng viêệt". The IME backspace character (\x08 BS on Windows) should be recognized and handled the same way \x7F (DEL) is handled on macOS/Linux.

Error Messages/Logs

No error messages. The bug is visual — characters are doubled/garbled silently.

Raw stdin capture shows the root cause:

# Windows IME sends \x08 (BS), NOT \x7F (DEL):
[timestamp] len=3 hex=[0x08 0xc3 0xaa] print=[<BS>ê]
[timestamp] len=4 hex=[0x08 0xe1 0xbb 0x87] print=[<BS>ệ]

# The TextInput handler receives: text="\x08ê", backspace=false
# It does NOT recognize \x08 as backspace → old char is kept → doubled output

Steps to Reproduce

  1. Install Claude Code on Windows: npm i -g @anthropic-ai/claude-code
  2. Enable a Vietnamese IME (Windows built-in Telex, UniKey, or EVKey)
  3. Launch claude in any terminal (cmd, PowerShell, Windows Terminal)
  4. At the prompt, type "tiếng việt" using Telex method (keystrokes: t-i-e-e-s-n-g space v-i-e-e-j-t)
  5. Observe: output shows "tieêếng viêệt" instead of "tiếng việt"

Environment:

  • OS: Windows 11 (10.0.26200)
  • Claude Code: v2.1.74
  • Node.js: v22.14.0
  • IME: Windows built-in Vietnamese Telex (also reproducible with UniKey, EVKey)

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.74

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Root Cause

Vietnamese IME on Windows sends \x08 (BS, charCode 8) for backspace-and-replace composition. Claude Code's TextInput handler only recognizes \x7F (DEL, charCode 127) which is used on macOS/Linux. The \x08 is ignored → old character is not deleted → doubled output.

Raw stdin evidence

When typing "việt" (Telex: v-i-e-e-j-t), Windows IME sends:

e (2nd) → 0x08 0xC3 0xAA       (BS + 'ê' in same read)
j       → 0x08 0xE1 0xBB 0x87  (BS + 'ệ' in same read)

Handler receives: text="\x08ê", backspace=false → does not delete old char.

Proposed fix

Add \x08 alongside \x7F in IME backspace detection:

// Before (macOS/Linux only):
text.match(/\x7f/g)
text.replace(/\x7f/g, "")

// After (all platforms):
text.match(/[\x7f\x08]/g)
text.replace(/[\x7f\x08]/g, "")

Affects

  • All Vietnamese IME on Windows (built-in Telex, UniKey, EVKey)
  • Likely other CJK/IME languages on Windows using backspace-and-replace composition

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗