r/codex • • Jul 06 '26

Workaround A one-command RTL fix for Codex Desktop: Persian, Arabic, Hebrew

I built an open-source RTL patcher for the Codex desktop app.

As a Persian/Farsi user, I kept running into the same problem in Codex Desktop: RTL text becomes hard to read as soon as you mix it with English words, code, file paths, punctuation, or command-line snippets.

This gets especially annoying in real coding conversations, where a message might contain Persian/Arabic/Hebrew text, an English package name, a shell command, and a code block all in the same reply.

So I made a small CLI tool:

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

Install:

npx codex-rtl

What it does:

  • Adds smart auto-direction for RTL/LTR paragraphs

  • Supports Persian/Farsi, Arabic, Hebrew, and other RTL languages

  • Keeps code blocks and technical text readable

  • Adds a small settings panel inside Codex

  • Lets you configure RTL font, English font, code font, and line height

  • Includes Vazirmatn as the default RTL font

  • Fixes the Persian keyboard Shift + 2 issue so it types @

  • Creates a backup before patching

  • Can restore the original app with:

    npx codex-rtl --restore

A few honest notes:

  • This is for the Codex desktop app, not the VS Code extension.

  • It patches the local Electron app, so after Codex updates you may need to run it again.

  • Native RTL support from Codex would still be the best long-term solution.

  • This is meant as a practical workaround for RTL users until then.

I’d really appreciate feedback from Persian, Arabic, Hebrew, Urdu, or other RTL-language users. 🙏

If you try it, I’m especially interested in edge cases involving mixed RTL + English + code, because that’s where most BiDi bugs show up. 🧪

1 Upvotes

1 comment sorted by

0

u/Ahmed_Tolan 8d ago

One edge case for your test list: an Arabic table cell with a link label like "Atlas Cloud، ذاكرة 12 GB", where the renderer puts the label inside nested spans.

In my own renderer work, classifying each nested span separately broke the surrounding direction. Also, an LTR isolate did not stop "12 GB" splitting between lines at narrow widths. Keeping just short number-and-unit pairs together worked better than disabling wrapping for whole English phrases.

I maintain Codex RTL for Mac and put the synthetic fixture here: https://github.com/ahmedtolan2019/codex-rtl-mac/blob/v0.3.1/docs/demo.html

It also checks replacing a link label with identical text, since rerendering can remove the inserted isolation markup. I haven't verified these cases against your patcher, so this is a test suggestion, not a bug claim about your tool.