Repository navigation
Closed
Description
What version of Codex CLI is running?
codex-cli 0.104.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
GPT-5.3-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Ghostty + fish
What issue are you seeing?
Word navigation via Option/Ctrl + Left/Right in TUI input is not CJK/Unicode-aware.
In mixed-language text, ASCII words behave mostly as expected, but CJK text is treated as one large segment (or has incorrect boundaries), making cursor movement inefficient and inconsistent with common CLI/editor behavior.
What steps can reproduce the bug?
- Open Codex CLI and type:
你好世界Hello你好World
- Put cursor at end of line.
- Press word-navigation keys:
- macOS:
Option + Left/Right - Windows/Linux:
Ctrl + Left/Right
- macOS:
- Observe cursor movement around CJK text.
What is the expected behavior?
Word navigation should follow Unicode-aware word boundaries (UAX #29 / ICU-like behavior), not ASCII-only heuristics.
Examples:
你好世界should navigate in multiple logical word steps (not as a single large token).Hello你好Worldshould stop at mixed-language boundaries predictably.
Additional information
- Context from related Codex Unicode boundary issues:
- Possibly related but not the same as Option + backspace does not delete the last word #4341 (terminal key-sequence transport discussion).
- Competitor reference (public): Gemini CLI uses
Intl.Segmenterfor CJK word navigation: - I have a local fix using
icu_segmenter+ tests and can provide patch details if maintainers are interested. - Reproduction videos:
OpenAI Codex
CleanShot.2026-02-20.at.11.11.05.mp4
Claude Code
CleanShot.2026-02-20.at.11.11.37.mp4
Reacted by Ignat Remizov, hellyr23 and gedalez
Activity
xiaotianxt commentedon Feb 20, 2026
@nornagon-openai could you please take a look when you have time?
I’ve prepared a candidate fix in my fork:
fix/cjk-word-nav-icu-segmenterupstream/mainIt switches word navigation to
icu_segmenterfor Unicode/CJK-aware boundaries.xiaotianxt commentedon Feb 27, 2026
Hi @etraut-openai , could you please take a look when you have time?
This CLI improvement can really improve CJK user experience.
oxysoft commentedon Mar 11, 2026
Cross-linking #12882 here because word-wise text selection in the composer should probably ride on the same boundary logic as word navigation.
If Codex adds selection parity like:
Shift+Left/Rightthen the word-boundary behavior becomes even more visible. It would be a shame to add word-selection shortcuts on top of ASCII-only segmentation.
etraut-openai commentedon Oct 12, 2026
(response from codex)
Closing as fixed by #16829 (included in CLI v0.162.1). Word navigation now uses Unicode boundaries within non-whitespace runs, so mixed CJK and Latin text no longer jumps as one word. Please reopen with an example on a current CLI if a boundary still behaves incorrectly.