Skip to content

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

Closed

Description

@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
  2. Put cursor at end of line.
  3. Press word-navigation keys:
    • macOS: Option + Left/Right
    • Windows/Linux: Ctrl + Left/Right
  4. 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

OpenAI Codex

CleanShot.2026-02-20.at.11.11.05.mp4

Claude Code

CleanShot.2026-02-20.at.11.11.37.mp4

Activity

  1. added
    bug
    CLI
    TUI
    on Feb 20, 2026
  2. removed
    CLI
    on Feb 20, 2026
  3. xiaotianxt commented on Feb 20, 2026

    @xiaotianxt
    Author

    @nornagon-openai could you please take a look when you have time?

    I’ve prepared a candidate fix in my fork:

    It switches word navigation to icu_segmenter for Unicode/CJK-aware boundaries.

  4. xiaotianxt commented on Feb 27, 2026

    @xiaotianxt
    Author

    Hi @etraut-openai , could you please take a look when you have time?
    This CLI improvement can really improve CJK user experience.

  5. oxysoft commented on Mar 11, 2026

    @oxysoft

    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/Right
    • word-jump selection with modified arrows
    • cut on selected text

    then the word-boundary behavior becomes even more visible. It would be a shame to add word-selection shortcuts on top of ASCII-only segmentation.

  6. etraut-openai commented on Oct 12, 2026

    @etraut-openai
    Contributor

    (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions