[BUG] Vietnamese IME (Unikey/Telex/OpenKey) broken — composed characters not inserted correctly

Resolved 💬 3 comments Opened Mar 27, 2026 by VietThuan Closed Mar 30, 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?

When using Vietnamese Input Method Editors (IME) such as Unikey, Telex, OpenKey, or EVKey on Windows, typing in Claude Code CLI produces incorrect or garbled text.
Composed Vietnamese characters (e.g. ă, ơ, ệ) either disappear, are not inserted, or extra unwanted characters appear.

The same issue occurs on macOS/Linux with Vietnamese IMEs.

To Reproduce

  1. Install a Vietnamese IME (e.g. Unikey on Windows, or OpenKey on macOS)
  2. Set input method to Telex or VNI
  3. Open Claude Code CLI (claude)
  4. Try to type Vietnamese text (e.g. type aa expecting â, or ow expecting ơ)

Expected behavior

Vietnamese IME composition works correctly — composed characters are inserted as expected, just like in any normal terminal or text editor.

Actual behavior

  • Composed characters are lost or not inserted
  • Extra garbage characters may appear
  • The input field behaves incorrectly after IME composition

Root Cause (technical)

The minified code in cli.js contains input-handling logic that checks for IME composition markers:

if (input.includes("\x7f")) {
// ... handles DEL (0x7F) sent by IME during composition
}

On macOS/Linux, IMEs send DEL (0x7F, \x7f) as a composition marker. On Windows, some IMEs send Backspace (0x08, \x08). The current handler detects these markers but
does not correctly perform the delete + insert sequence needed to commit the composed text:

  1. It counts the number of \x7f markers (= number of characters to delete)
  2. It performs the deletions
  3. But it does not insert the replacement composed text character-by-character

As a result, the composed Vietnamese characters are never inserted into the input buffer.

Proposed Fix

The correct handling should:

  1. Detect IME markers \x7f (DEL) or \x08 (BS) — covering both macOS/Linux and Windows IMEs
  2. Count the number of markers (N)
  3. Extract the composed text = substring after the last marker
  4. Delete N times using state.deleteTokenBefore() ?? state.backspace()
  5. Insert the composed text character-by-character: for (const c of composedText) state = state.insert(c)
  6. Call updateText(state.text); updateOffset(state.offset) to commit state
  7. Guard against false positives: !keyInfo.backspace && !keyInfo.delete

Additional context

This is a known issue in the Vietnamese developer community. A community workaround exists that patches the installed cli.js at runtime. The patch works by finding the if (input.includes("\x7f")) blocks and replacing them with the correct delete-then-insert logic.

Community patch script: https://github.com/0x0a0d/fix-vietnamese-claude-code

A proper fix in the source code would eliminate the need for this runtime patcher and benefit all Vietnamese-language users of Claude Code (~100M people use
Vietnamese).

Environment

  • OS: Windows 10/11 (confirmed); also reported on macOS/Linux
  • IME: Unikey, Telex mode; also OpenKey, EVKey
  • Claude Code: multiple versions affected (issue is in minified input-handling logic)

What Should Happen?

Vietnamese IME composition works correctly — composed characters are inserted as expected, just like in any normal terminal or text editor.

For example:

  • Typing aa with Telex method → inserts â
  • Typing ow with Telex method → inserts ơ
  • Typing eej with Telex method → inserts ề

Error Messages/Logs

Steps to Reproduce

  1. Install a Vietnamese IME on Windows (e.g. https://www.unikey.org/ or https://github.com/tuyenvm/OpenKey), set input method to Telex or VNI
  2. Open Claude Code CLI (claude)
  3. Start a new conversation or type in any input prompt
  4. Type a Vietnamese word using IME composition — e.g. type aa (expecting â), or ow (expecting ơ), or eej (expecting ề)

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.81

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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