Codex CLI Backspace deletes whole Thai syllables/words instead of individual combining marks
Summary
In the Codex CLI interactive input box, editing Thai text with Backspace deletes a whole Thai grapheme/syllable or sometimes the whole composed word segment, instead of deleting one visible Thai vowel/tone mark at a time. This makes it difficult to correct Thai prompts directly inside the TUI.
Environment
- Package:
@openai/codex - Codex CLI version:
codex-cli 0.142.4 - OS: Windows 11 / Windows build
10.0.26100 - Terminal: Windows Terminal
- Shell: Windows PowerShell 5.1
- Launch command used:
chcp 65001
[Console]::InputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$env:LANG = "th_TH.UTF-8"
codex --no-alt-screen
Reproduction Steps
- Open Windows Terminal.
- Run the PowerShell setup above to switch the session to UTF-8.
- Start Codex CLI with
codex --no-alt-screen. - In the Codex CLI prompt input field, type Thai text that contains vowels/tone marks, for example:
คำสั่งภาษาไทย
ไม่ได้
แก้ไขคำไทย
- Place the cursor after a Thai word or composed Thai syllable.
- Press Backspace once.
Expected Behavior
Backspace should allow predictable character-level editing for Thai input. For example, when deleting within a Thai composed syllable, it should remove the last Thai combining mark/vowel/tone mark or otherwise behave consistently with the host terminal/editor behavior.
Actual Behavior
Backspace deletes a whole Thai grapheme/syllable cluster, and in some cases appears to delete an entire word segment, instead of deleting one Thai vowel/tone mark at a time. The result is that Thai text corrections inside the Codex CLI input field remove more text than intended.
Notes
This does not appear to be a startup or stdout encoding problem. The CLI can start, and the issue is specifically the interactive input editor behavior in the TUI. Running with code page 65001 and UTF-8 console input/output does not resolve the Backspace behavior.
This looks related to Unicode grapheme cluster / IME composition handling in the line editor used by the Codex CLI TUI on Windows.