You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codex app has inconsistent RTL rendering for Persian/Farsi messages. Mixed Persian and English text, punctuation, and inline code often display in the wrong direction and become hard to read. Please add proper RTL support or a setting to force message direction per language.
Reacted by zvi, Sajjad Majdi, Ghasem Nazari, Muhammad Yaseen, Monar DEV, zaherrezai, shambibambi and Mohammadreza
The Codex desktop app has inconsistent RTL rendering for Persian/Farsi messages. Persian text mixed with English words, punctuation, or inline code is displayed in the wrong direction and becomes hard to read.
Please add proper RTL support or a setting to force message direction for RTL languages.
Language: Persian/Farsi
Platform: Windows
App: Codex desktop app
I’d like to add that this issue is not limited to Persian/Farsi. It also affects Arabic, Hebrew, Urdu, Pashto, and potentially other right-to-left languages.
In Codex, the basic RTL support itself seems to be missing or incomplete.
By contrast, ChatGPT has better RTL support in both the browser and the app, although it still suffers from the same bidirectional text rendering issue described here.
Reacted by Eltay, Ahmed Abdou, zvi, Muhammad Yaseen and zaherrezai
It patches the app locally, keeps code/file paths readable in LTR, adds smart RTL/force RTL modes, custom RTL fonts/line-height, and can be reverted with npx codex-rtl --restore.
It’s not a replacement for native upstream support, but it may help Arabic/Hebrew/Persian users meanwhile. I’m the author and would love feedback from people affected by this.
There is one important case beyond a global RTL rule or plain dir="auto":
React یک کتابخانه جاوااسکریپت بسیار محبوب است.
The source is already in correct logical order: React is first, the Persian words follow it, and the period should appear at the visual left edge. dir="auto" / unicode-bidi: plaintext chooses LTR because React is the first strong run, even though the prose is overwhelmingly RTL. The inverse also occurs when an RTL token appears before English-majority prose.
For the app/extension renderer, I suggest:
resolve direction per structural block (p, list item, heading, quote, and table cell), not once for an entire response;
use Unicode strong-character majority (L versus R/AL), with first-strong as the tie fallback;
set the chosen base explicitly, then isolate inline code, commands, paths, URLs, model names, and identifiers;
keep code blocks and terminal transcripts LTR;
expose Auto/LTR/RTL at the message/composer level;
preserve logical source text for copy, accessibility, persistence, and search;
leave pure-LTR content untouched.
This also avoids the risk reported above from tools that patch application files. A native integration should operate at the render boundary and be removable/idempotent, without modifying stored chats or model output.
Maintainer disclosure: I maintain BidiLens, an MIT-licensed toolkit built for this exact AI-output failure mode. Version 0.1.1 provides DOM, React, Markdown, streaming, terminal, CLI, and verification surfaces plus 918 schema-validated fixtures. I am offering it for engineering review/pilot and am not claiming OpenAI endorsement.
There is now a focused example of the policy integrated into another AI terminal renderer at NousResearch/hermes-agent#72508: it uses the host's existing bidi dependency, tests both majority directions and ties, and preserves an ASCII identity fast path. I would be glad to prepare the equivalent native patch when the relevant Codex app/extension renderer source is available.
The Windows CLI problem is a separate rendering layer tracked in #34871; CSS alone cannot solve terminal bidi or shaping.
Adding a few concrete regression boundaries to my earlier comment. A single RTL rule and first-strong dir="auto" both miss different cases:
Capsule مثل یک روکش لیز و ضدچسب دور باکتری است.
PEP + ADP → Pyruvate + ATP
The Persian word طحال means spleen in English.
For declared Persian intent in the first paragraph, Capsule should be at the right-hand reading start while its letters stay internally LTR. The other two paragraphs need LTR bases. This must still work if the host deliberately aligns the text physically left.
Two additional useful inline cases are IgM + complement (one ordered LTR unit in Persian prose), and the complete literal \bTB\b (both backslashes must stay inside the code boundary and copy unchanged). Isolating just the Latin middle word is insufficient for bracketed query syntax such as [[:<:]]TB[[:>:]].
An important limitation of the majority approach I suggested earlier: a Persian sentence with long English technical terms can have a Latin character majority. Known author intent needs an explicit per-paragraph policy or host-declared technical identifiers, not a claim of perfect automatic language detection. A forced setting should not accidentally force the separate formula block RTL.
Maintainer disclosure: I maintain BidiLens. I've added a small engineering packet, 390 px before/after fixtures, and browser regressions covering reading-edge geometry, logical selection, literal characters and preserved host alignment. All 90 controlled browser checks passed locally across Chromium/Firefox/WebKit. These are curated reconstructions inspired by user-supplied mobile screenshots, not a reproduction inside Codex or a modified ChatGPT client. The repairs are on an unreleased source branch, not yet in published packages.
The fixtures are MIT-licensed and can be used with native direction/isolation primitives without taking a BidiLens dependency. If useful for the Codex app renderer, a bounded read-only message pilot could retain logical source for persistence/copy and run behind a reversible feature flag. No stored chats, prompts, or application files need to be rewritten. The CLI/terminal issue remains a separate rendering layer.
I can reproduce a more specific mixed RTL/LTR failure mode in Persian technical writing, and I think it helps clarify what the renderer needs to distinguish.
The important distinction is between:
the base direction of a semantic block (paragraph, list item, heading, table cell), and
the direction of inline spans inside that block (English technical terms, identifiers, IPs, paths, hashes, code, etc.).
For example, this is semantically a Persian/RTL list item even though it begins with an English token:
PRESENT — پیکربندی این Transport وجود دارد.
Expected rendering:
the whole list item / sentence has RTL base direction;
PRESENT and Transport remain LTR inline spans;
punctuation and dash placement follow the RTL sentence correctly.
A simple first-strong-character heuristic (or plain dir="auto") can get this wrong because the first strong token is PRESENT, causing the entire block to be treated as LTR.
Counter-example: these lines are genuinely English and should remain LTR even inside a Persian conversation:
Addressing Standard
Transport Module Parity Standard
Shared Standards / RTL Governance Proposal
So the desired behavior is not “force every block in a Persian conversation to RTL”. Direction should be determined per semantic block, while opposite-direction inline fragments should be isolated.
A more robust rendering model would be:
determine base direction independently for each paragraph, heading, list item, block quote, and table cell;
infer that base direction from the dominant natural-language script/content of the block, discounting technical tokens such as inline code, URLs, paths, IPs, hashes, identifiers, and version strings;
isolate opposite-direction inline spans using bidi isolation (<bdi>, unicode-bidi: isolate, or equivalent Unicode isolates);
handle Markdown tables cell-by-cell rather than inheriting one direction for the whole table.
This matters especially in networking / software / DevOps conversations, where Persian, Arabic, or Hebrew prose naturally contains many English technical tokens.
I also verified an important clue: when the rendered response is copied from ChatGPT and pasted into Word, Word often displays the same mixed sentence correctly. That suggests the underlying text itself is fine and the problem is primarily in the chat renderer's block direction / bidi handling.
I submitted this separately through in-app feedback as well. The core desired behavior is:
Infer the base direction from the semantic language of each block, and isolate inline spans with the opposite direction.
Activity
EltayApps commentedon May 7, 2026
The Codex desktop app has inconsistent RTL rendering for Persian/Farsi messages. Persian text mixed with English words, punctuation, or inline code is displayed in the wrong direction and becomes hard to read.
Please add proper RTL support or a setting to force message direction for RTL languages.
Language: Persian/Farsi
Platform: Windows
App: Codex desktop app
github-actions commentedon May 7, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Tarek-g commentedon May 7, 2026
I’d like to add that this issue is not limited to Persian/Farsi. It also affects Arabic, Hebrew, Urdu, Pashto, and potentially other right-to-left languages.
In Codex, the basic RTL support itself seems to be missing or incomplete.
By contrast, ChatGPT has better RTL support in both the browser and the app, although it still suffers from the same bidirectional text rendering issue described here.
nad3rzz commentedon May 10, 2026
https://marketplace.visualstudio.com/items?itemName=Nad3r.agents-rtl
https://github.com/nad3rzz/agents-rtl
pawnsmaster commentedon Jul 1, 2026
I ran into the same issue and built a small open-source workaround for Codex Desktop RTL rendering.
It fixes mixed Arabic/English direction and keeps code blocks LTR:
https://github.com/pawnsmaster/codex-rtl-toolkit
Would be happy to hear if it works for your case too.
mmnaderi commentedon Jul 6, 2026
I ran into this too and built an open-source patch for the Codex desktop app:
⭐ https://github.com/mmnaderi/codex-rtl
It patches the app locally, keeps code/file paths readable in LTR, adds smart RTL/force RTL modes, custom RTL fonts/line-height, and can be reverted with npx codex-rtl --restore.
It’s not a replacement for native upstream support, but it may help Arabic/Hebrew/Persian users meanwhile. I’m the author and would love feedback from people affected by this.
EltayApps commentedon Jul 7, 2026
It works fine for RTL, but after running, I lost all my chats on the Codex workspace.
pawnsmaster commentedon Jul 23, 2026
Don’t waste time on this issue. Use this one-click solution until OpenAI fixes it officially:
https://github.com/pawnsmaster/codex-rtl-toolkit
CodeinScrubs commentedon Jul 27, 2026
There is one important case beyond a global RTL rule or plain
dir="auto":The source is already in correct logical order:
Reactis first, the Persian words follow it, and the period should appear at the visual left edge.dir="auto"/unicode-bidi: plaintextchooses LTR becauseReactis the first strong run, even though the prose is overwhelmingly RTL. The inverse also occurs when an RTL token appears before English-majority prose.For the app/extension renderer, I suggest:
p, list item, heading, quote, and table cell), not once for an entire response;LversusR/AL), with first-strong as the tie fallback;This also avoids the risk reported above from tools that patch application files. A native integration should operate at the render boundary and be removable/idempotent, without modifying stored chats or model output.
Maintainer disclosure: I maintain BidiLens, an MIT-licensed toolkit built for this exact AI-output failure mode. Version 0.1.1 provides DOM, React, Markdown, streaming, terminal, CLI, and verification surfaces plus 918 schema-validated fixtures. I am offering it for engineering review/pilot and am not claiming OpenAI endorsement.
There is now a focused example of the policy integrated into another AI terminal renderer at NousResearch/hermes-agent#72508: it uses the host's existing bidi dependency, tests both majority directions and ties, and preserves an ASCII identity fast path. I would be glad to prepare the equivalent native patch when the relevant Codex app/extension renderer source is available.
The Windows CLI problem is a separate rendering layer tracked in #34871; CSS alone cannot solve terminal bidi or shaping.
CodeinScrubs commentedon Oct 2, 2026
Adding a few concrete regression boundaries to my earlier comment. A single RTL rule and first-strong
dir="auto"both miss different cases:For declared Persian intent in the first paragraph,
Capsuleshould be at the right-hand reading start while its letters stay internally LTR. The other two paragraphs need LTR bases. This must still work if the host deliberately aligns the text physically left.Two additional useful inline cases are
IgM + complement(one ordered LTR unit in Persian prose), and the complete literal\bTB\b(both backslashes must stay inside the code boundary and copy unchanged). Isolating just the Latin middle word is insufficient for bracketed query syntax such as[[:<:]]TB[[:>:]].An important limitation of the majority approach I suggested earlier: a Persian sentence with long English technical terms can have a Latin character majority. Known author intent needs an explicit per-paragraph policy or host-declared technical identifiers, not a claim of perfect automatic language detection. A forced setting should not accidentally force the separate formula block RTL.
Maintainer disclosure: I maintain BidiLens. I've added a small engineering packet, 390 px before/after fixtures, and browser regressions covering reading-edge geometry, logical selection, literal characters and preserved host alignment. All 90 controlled browser checks passed locally across Chromium/Firefox/WebKit. These are curated reconstructions inspired by user-supplied mobile screenshots, not a reproduction inside Codex or a modified ChatGPT client. The repairs are on an unreleased source branch, not yet in published packages.
The fixtures are MIT-licensed and can be used with native direction/isolation primitives without taking a BidiLens dependency. If useful for the Codex app renderer, a bounded read-only message pilot could retain logical source for persistence/copy and run behind a reversible feature flag. No stored chats, prompts, or application files need to be rewritten. The CLI/terminal issue remains a separate rendering layer.
Mohammad-Samini commentedon Oct 3, 2026
I can reproduce a more specific mixed RTL/LTR failure mode in Persian technical writing, and I think it helps clarify what the renderer needs to distinguish.
The important distinction is between:
For example, this is semantically a Persian/RTL list item even though it begins with an English token:
PRESENT — پیکربندی این Transport وجود دارد.Expected rendering:
PRESENTandTransportremain LTR inline spans;A simple first-strong-character heuristic (or plain
dir="auto") can get this wrong because the first strong token isPRESENT, causing the entire block to be treated as LTR.Counter-example: these lines are genuinely English and should remain LTR even inside a Persian conversation:
So the desired behavior is not “force every block in a Persian conversation to RTL”. Direction should be determined per semantic block, while opposite-direction inline fragments should be isolated.
A more robust rendering model would be:
<bdi>,unicode-bidi: isolate, or equivalent Unicode isolates);This matters especially in networking / software / DevOps conversations, where Persian, Arabic, or Hebrew prose naturally contains many English technical tokens.
I also verified an important clue: when the rendered response is copied from ChatGPT and pasted into Word, Word often displays the same mixed sentence correctly. That suggests the underlying text itself is fine and the problem is primarily in the chat renderer's block direction / bidi handling.
I submitted this separately through in-app feedback as well. The core desired behavior is: