Skip to content

[Bug] Incorrect text rendering and alignment for RTL (Right-to-Left) languages #14578

Done

Description

@shm379

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.311.21342 (993)

What subscription do you have?

[Bug] Incorrect text rendering and alignment for RTL (Right-to-Left) languages

What platform is your computer?

macuname -mprs

What issue are you seeing?

Describe the bug

When typing or generating text in Right-to-Left (RTL) languages like Persian or Arabic, especially when mixed with English words (LTR), the text rendering breaks. The text alignment defaults to left-to-right, punctuation marks appear in the wrong places, and the word order gets visually shuffled, making the output very hard to read.

Steps to reproduce

  1. Open the macOS app / output window.
  2. Input or generate a paragraph in Persian (or Arabic) that contains a few English words (e.g., "CRM", "onboarding").
  3. Look at the rendered output.
  4. Notice that the text is left-aligned and the bidirectional (bidi) text formatting is broken.

Expected behavior

  • The text container for RTL languages should automatically detect the direction and set direction: rtl; and text-align: right;.
  • Mixed LTR words inside the RTL text should maintain their proper inline order (proper unicode-bidi handling).

Actual behavior

  • Text is aligned to the left.
  • Sentences are visually broken when an English word is inserted among Persian words.

Screenshots

Image

Environment

  • OS: macOS
  • Language: Persian / RTL

What steps can reproduce the bug?

Gemini said
Here are the exact steps you can use to reproduce the RTL (Right-to-Left) rendering bug, formatted clearly so you can add them directly to your GitHub issue:

Open the application: Launch the Codex macOS app and open a new document, chat, or text input window.

Input RTL text: Type or paste a paragraph of text in an RTL language, such as Persian or Arabic.

Mix in LTR words: Insert a few English words or technical terms (like "CRM", "MVP", or "onboarding") within the Persian sentences.

Observe the result: Look at how the text is rendered on the screen.

What happens (The Bug): You will see that the text forces itself to align to the left side of the screen instead of the right. Additionally, the sentence structure visually breaks and shuffles around wherever the English words are inserted, ignoring proper bidirectional (bidi) text rules.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    app
    on Mar 13, 2026
  2. added
    bug
    on Mar 13, 2026
  3. BehroozBvk commented on Apr 22, 2026

    @BehroozBvk

    I have the same problem.

  4. meshalprogramming-cloud commented on Apr 25, 2026

    @meshalprogramming-cloud

    same problem

  5. SMSMy commented on May 2, 2026

    @SMSMy

    I’m also experiencing this issue, and it significantly impacts real-world usage.

    Reproducible Case

    When mixing Arabic (RTL) with English/code (LTR), the output becomes hard to read:

    Example:

    • Arabic comment + English code
    • Terminal output containing Arabic text
    • Markdown with mixed direction

    Observed problems:

    • Text alignment defaults to LTR
    • Parentheses and punctuation are misplaced
    • Mixed content (Arabic + code) becomes visually inconsistent

    Impact

    This is not just a visual issue — it affects:

    • Code readability
    • Debugging (logs/CLI output)
    • UI correctness when generating layouts

    Suggestion

    Proper bidirectional text handling is needed:

    • Support for RTL direction (dir="rtl" or auto)
    • Correct Unicode Bidi algorithm implementation
    • Testing in mixed-language scenarios (Arabic + English + code)

    If needed, I can provide more concrete examples or test cases.

  6. arefshal commented on May 4, 2026

    @arefshal

    same problem

  7. Ebrahem-Abdon commented on May 8, 2026

    @Ebrahem-Abdon

    I’m also experiencing this issue, and it significantly impacts real-world usage.

    Reproducible Case

    When mixing Arabic (RTL) with English/code (LTR), the output becomes hard to read:

    Example:

    Arabic comment + English code
    Terminal output containing Arabic text
    Markdown with mixed direction
    Observed problems:

    Text alignment defaults to LTR
    Parentheses and punctuation are misplaced
    Mixed content (Arabic + code) becomes visually inconsistent
    Impact

    This is not just a visual issue — it affects:

    Code readability
    Debugging (logs/CLI output)
    UI correctness when generating layouts
    Suggestion

    Proper bidirectional text handling is needed:

    Support for RTL direction (dir="rtl" or auto)
    Correct Unicode Bidi algorithm implementation
    Testing in mixed-language scenarios (Arabic + English + code)
    If needed, I can provide more concrete examples or test cases.

  8. ctrlbstudioai-wq commented on Jun 16, 2026

    @ctrlbstudioai-wq

    codex pleas help us and fixed

  9. mmnaderi commented on Jul 6, 2026

    @mmnaderi

    As a Persian/Farsi user, this is exactly the issue I kept hitting in Codex Desktop, especially with mixed English words, punctuation, and inline code.

    I made a small open-source patcher for this:

    ⭐ https://github.com/mmnaderi/codex-rtl

    It adds smart RTL behavior and a settings panel, while preserving code blocks as LTR.
    Hope it helps until Codex gets native RTL support.

  10. soguy commented on Jul 22, 2026

    @soguy

    Same problem in Hebrew. Please fix.

  11. nicktechmirahmadi-creator commented on Jul 24, 2026

    @nicktechmirahmadi-creator

    Please add complete RTL support to the Codex app, similar to the current ChatGPT web interface. Persian and Arabic responses should automatically use right-to-left paragraph direction, while code blocks and English text remain left-to-right. Mixed Persian/English content, punctuation, parentheses, numbered lists, diffs, terminal output, and inline code should render without visual reordering. Using automatic direction detection such as dir="auto" together with appropriate Unicode bidirectional handling would significantly improve Codex for Persian- and Arabic-speaking developers.

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

    appbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions