TUI: Option/Ctrl+Arrow word navigation is not CJK/Unicode-aware

Open 💬 3 comments Opened Feb 20, 2026 by xiaotianxt

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?

  1. Open Codex CLI and type:
  • 你好世界
  • Hello你好World
  1. Put cursor at end of line.
  2. Press word-navigation keys:
  • macOS: Option + Left/Right
  • Windows/Linux: Ctrl + Left/Right
  1. 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你好World should stop at mixed-language boundaries predictably.

Additional information

  • Context from related Codex Unicode boundary issues:
  • #3588
  • #3261
  • #5016
  • Possibly related but not the same as #4341 (terminal key-sequence transport discussion).
  • Competitor reference (public): Gemini CLI uses Intl.Segmenter for CJK word navigation:
  • https://github.com/google-gemini/gemini-cli/pull/14475
  • I have a local fix using icu_segmenter + tests and can provide patch details if maintainers are interested.
  • Reproduction videos:

OpenAI Codex

https://github.com/user-attachments/assets/82ea499e-c2a7-494c-b080-5780aa8ba799

Claude Code

https://github.com/user-attachments/assets/a8e4aaab-073b-4045-a0d9-57311e2bb1af

View original on GitHub ↗

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