Arabic text in a Windows terminal

Terminals are built on a grid of equal cells, which suits Latin text and fights Arabic. Najm can draw Arabic in a monospace font with one config line, but it does not reorder lines right to left yet.

What works today

  • Works: Arabic letters take their joined forms, and the font line below keeps them on the cell grid.
  • Does not work yet: a line stays in left-to-right cell order, so Arabic in plain command output reads backwards. Some pairs, such as lam-alef, also draw badly. Najm has no bidirectional layout today.

Set the font in three steps

  1. Install the current Cascadia Code release. The copy that ships with Windows has no Arabic.
  2. Add this line to %LOCALAPPDATA%\najm\config.ghostty:
font-codepoint-map = U+0600-U+06FF,U+0750-U+077F,U+08A0-U+08FF,U+FB50-U+FDFF,U+FE70-U+FEFF=Cascadia Code NF
  1. Press Ctrl+Shift+, to reload the config.

Why the font line matters

The default terminal fonts have no Arabic, so Windows draws it in Segoe UI. That font is proportional, so it sits unevenly in the grid. The line above sends every Arabic block to a monospace font that has them, and the text lines up.

To see which font each letter comes from, run:

najm +show-face --string="مرحبا"

Read this page in Arabic

Najm's site has an Arabic version.

Questions

Does Najm display Arabic right to left?

Not yet. Najm draws Arabic letters in their joined forms, but it keeps a line in left-to-right cell order, so Arabic in plain command output reads backwards. There is no bidirectional layout in the renderer today.

Why does Arabic look uneven in my terminal?

Most terminal fonts have no Arabic, so Windows draws it in a proportional font that sits unevenly in the cell grid. Map the Arabic blocks to a monospace font that has them.

Which font should I use for Arabic?

The current release of Cascadia Code from Microsoft's GitHub has Arabic. The copy that ships with Windows does not, so install the release.

Try Najm on your machine

Free and open source. It installs beside your current terminal.