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
there are multiple issues
first the characters shaping is wrong
in Arabic and Persian each glyph changes shape depending on the glyph behind it and after it for example:
ignore the "e)" it is there just to make the Arabic text left aligned
e) ي + ز + ن
the first letter is "ي" and the last is "ن"
should be shaped like this
e) يـ + ـز + ن
not like this
e) ( ي + ز + ن ) or (ي + ز + ـن)
the second issue is glyph order in each word
e) علي (correct)
even if the first issue was fixed the text will look like this
e) ﻲﻠﻋ (wrong)
the third issue is word ordering, I don't think there is one correct answer there are two options
the first is to not change anything firstWord secondWord
or make it like konsole secondWord firstWord
Reacted by mustafa0x, Ahmed El-Helw, Munzir Taha, Roham Hayedi, Shahab Rezaee, Ali T., Rayane Nakib (ريّان نقيب), Muhannad H., Mohamed Ibraheem, Alyaman Massarani and 61 more
I'll say up front I'm not very familiar with RTL languages on computers. I have read the full RTL/Bidi terminal spec here and I don't currently plan on supporting that in the near term since it requires a very significant amount of effort that I'm not ready to put forward. One day, I'd like to support this.
If what you're suggesting can be resolved in a renderer/shaping-only way then I think we can at least get partial RTL support, so I'll keep this open for that. 😄 More research necessary.
Thank you for the example text and screenshots, this will help significantly.
Reacted by Ahmed ElSayed, Arash Jafarpour, Rayane Nakib (ريّان نقيب), Adeel Ahmad, Samuel Lo, Abdalr7man_Mohamed, 8uff3r, Abod Builds, andrew sòlanto, Erfan Mowlavian and 2 more
Reacted by محمد الصوالحي and Rachad
Reacted by Cameron Ball, Mansour Ashraf, Abod Builds, Sahir Hoda, Erfan Mowlavian, Arash Esmaealbeigy and Mohammad Alhomaid
Hello. I meant to open an issue regarding this but found this one. I am using the 1.0 Dec26 version of Ghostty. I am on MacOS.
The shaping seems to work fine. All the letters are shaped properly. Problem is they are the wrong order. If I were to guess, they are probably passed to the shaper in the opposite order of what they should be. I don't know what shaper you're using, but HarfBuzz and rustybuzz want the text in the logical order and they give you the rendering order from left to right.
minimal example
Here is how it looks (correctly) in Terminal.app
Reacted by Saif Waleed, Meitham, Ali T., Rayane Nakib (ريّان نقيب), Samuel Lo, Mansour Ashraf, Sahir Hoda and محمد الصوالحي
Could I suggest a slight tweak to the wording of the features page related to this? That page currently says:
Certain languages like Arabic and Hebrew are also rendered correctly (LTR only).
which is a little like saying "English text renders correctly (backwards only)." I think it would be clearer to say something like:
While only left-to-right text is supported, characters from RTL scripts including Arabic and Hebrew are correctly clustered and rendered.
Ghostty does not render characters in RTL scripts correctly, though. They are rendered backwards. Would you say olleh is a correct clustering and rendering of hello? It would be much clearer to say that Ghostty does not support RTL scripts (like Arabic and Hebrew).
Reacted by Rayane Nakib (ريّان نقيب) and Nick Guerrera
Can't some grant be secured from the rich Gulf states? UAE invests so heavily in new technology.
@mitchellh Perhaps if you try to reach out, they'll pay for adding this feature. I have no idea how to do that though. Perhaps through a collaboration with someone at MBZUAI.
Reacted by Leah Amelia Chen, thesmartwon, Amir, Salem Sayed Abdel Gawad and ahmadtv
b) Ghostty is an all-volunteer project and nobody here is interested in financial gains. Mitchell doesn't particularly need oil money only made possible with indentured labor, either. Perhaps instead of capital, lend us some hands instead.
Reacted by Ori Avtalion, ej shafran, Hussien Liban, Boris Valdman, Cameron Ball, DivergentClouds and Mansour Ashraf
Working local implementation of the renderer/shaping-only scope from this issue. Tested with cat arabic.txt, mixed Latin/Arabic prompts, and against Apple Terminal output.
Stack: uucode bidi runtime fields, itijah (pure-Zig UAX #9) + visual run iterator with LTR fast path, HarfBuzz + CoreText consume run direction, renderer applies UAX #9 reorder per row, cursor + selection mapping for mixed-direction lines. 4 PRs ready on stacked local branches.
Happy to coordinate with @DiaaNoon on #11079, willing to take it over, fold approaches together, or rebase mine onto theirs, whichever the maintainers prefer.
Reacted by Ahmed Elawad, Ahmed El-Helw, Amr Abdelaziz, 8uff3r, iMostfa, Ali Afghah, Mhmd Amed and Mohammad AlQuraian
@ibrahimhajjaj could you share your fork? Happy to work together on this on #11079. Regarding cursor, it was left out of this PR intentionally per Mitchell's preference in the 2024 discussion on #1442, and will be addressed in follow-up work. wdyt?
bidi/run-iterator: uucode bidi fields, itijah dep, run splitting at level boundaries, ltr fast path (skips bidi entirely on rows with no strong-rtl cells), bidi-scan bench
bidi/shaper: harfbuzz + coretext consume run.rtl
bidi/cursor-selection: cursor visual mapping for mixed-direction lines
bidi/rtl-justify: per-row uax Charsets #9 logical to visual reorder at the renderer (cell.x stays logical in the shaper) + rtl-justify config flag
itijah is yours and it's the dep under both stacks, glad it exists. the architectural difference is mostly where the visual reorder happens. your run iterator emits visual order, mine keeps the iterator logical and does logToVis at the renderer. mine has the ltr fast path. tested on macos arm with al-fatihah verses, lam-alef, mixed latin/arabic, right-justify all working.
i'll leave the two stacks parallel and let mitchell pick the architecture when he gets to it. wdyt?
re cursor: keeping it on its own branch as v2 since you confirmed mitchell scoped it out. not bundling it into v1.
Thanks for sharing the branches. Went through them, really nice work.
A few notes from comparing the approaches: the shaper side handles mark anchoring a bit differently. Your branch mirrors clusters, while #11079 tracks per-cluster anchors. Your LTR fast path was a good idea too; I added the same general optimization at the itijah layer in 0.2.1 via hasStrongRtl and an allocation-free pre-scan inside getParEmbeddingLevels, so callers can benefit without each integration adding its own check.
Parallel stacks sound fine to me; that gives Mitchell both shapes to compare when he gets to it. Your cursor-selection and rtl-justify branches cover exactly the terminal-side scope deferred from #11079. Happy to look at collaborating on those follow-ups once #11079 lands.
I’m seeing the same issue with Arabic in Ghostty: Arabic should render right-to-left, but it is currently displayed left-to-right / in the wrong visual order.
This makes Arabic command output, filenames, and Arabic text in terminal apps difficult to read. Other terminals such as Terminal.app render the same Arabic text correctly, so this appears to be the RTL/BiDi terminal-surface issue tracked here.
Adding this as another Arabic-language data point and to ask that proper RTL/BiDi support be prioritized.
Reacted by Mamouri, Raed, Jihad, Mansour, Hossein, Ahmed Emad and xxxstar123
Activity
mitchellh commentedon Feb 2, 2024
I'll say up front I'm not very familiar with RTL languages on computers. I have read the full RTL/Bidi terminal spec here and I don't currently plan on supporting that in the near term since it requires a very significant amount of effort that I'm not ready to put forward. One day, I'd like to support this.
If what you're suggesting can be resolved in a renderer/shaping-only way then I think we can at least get partial RTL support, so I'll keep this open for that. 😄 More research necessary.
Thank you for the example text and screenshots, this will help significantly.
[-]support RTL languages[/-][+]minimal RTL support for single lines[/+]asibahi commentedon Dec 27, 2024
Hello. I meant to open an issue regarding this but found this one. I am using the 1.0 Dec26 version of Ghostty. I am on MacOS.
The shaping seems to work fine. All the letters are shaped properly. Problem is they are the wrong order. If I were to guess, they are probably passed to the shaper in the opposite order of what they should be. I don't know what shaper you're using, but HarfBuzz and rustybuzz want the text in the logical order and they give you the rendering order from left to right.
minimal example
Here is how it looks (correctly) in Terminal.app
eifr commentedon Dec 28, 2024
same on fedora 41

kitty(right) ordering the letters correctly:
motaz-shokry commentedon Dec 29, 2024
Until the RTL Support added in the future I encourage you to use bicon with ghostty, or use wezterm "it supports RTL very will
mjec commentedon Dec 30, 2024
Could I suggest a slight tweak to the wording of the features page related to this? That page currently says:
which is a little like saying "English text renders correctly (backwards only)." I think it would be clearer to say something like:
mitchellh commentedon Dec 30, 2024
@mjec Happy to make that change, would you be open to PR-ing it to the website repo?
Flimm commentedon Dec 31, 2024
Ghostty does not render characters in RTL scripts correctly, though. They are rendered backwards. Would you say
ollehis a correct clustering and rendering ofhello? It would be much clearer to say that Ghostty does not support RTL scripts (like Arabic and Hebrew).21 remaining items
NightMachinery commentedon Sep 27, 2025
Can't some grant be secured from the rich Gulf states? UAE invests so heavily in new technology.
@mitchellh Perhaps if you try to reach out, they'll pay for adding this feature. I have no idea how to do that though. Perhaps through a collaboration with someone at MBZUAI.
NightMachinery commentedon Sep 27, 2025
Can you use bicon with ARM macOS? The last time I checked it didn't work.
pluiedev commentedon Sep 27, 2025
a) Please do not ping maintainers.
b) Ghostty is an all-volunteer project and nobody here is interested in financial gains. Mitchell doesn't particularly need oil money only made possible with indentured labor, either. Perhaps instead of capital, lend us some hands instead.
1saifj commentedon Feb 15, 2026
DiaaNoon commentedon May 1, 2026
if anyone is interested
already did a fix on the font/shaper side
#11079
here is the build of that pr if you wanna quickly test it (built for macos - universal)
https://github.com/DiaaEddin/ghostty/releases
Flimm commentedon May 2, 2026
Yes, that looks interesting! The pull request is by @DiaaEddin , not by @DiaaNoon , I'm a bit confused.
DiaaEddin commentedon May 2, 2026
yeah sorry about that, DiaaNoon is my work account,
ibrahimhajjaj commentedon May 9, 2026
Working local implementation of the renderer/shaping-only scope from this issue. Tested with
cat arabic.txt, mixed Latin/Arabic prompts, and against Apple Terminal output.Stack: uucode bidi runtime fields, itijah (pure-Zig UAX #9) + visual run iterator with LTR fast path, HarfBuzz + CoreText consume run direction, renderer applies UAX #9 reorder per row, cursor + selection mapping for mixed-direction lines. 4 PRs ready on stacked local branches.
Vouch request with screenshot: #12624
Happy to coordinate with @DiaaNoon on #11079, willing to take it over, fold approaches together, or rebase mine onto theirs, whichever the maintainers prefer.
jcollie commentedon May 9, 2026
@ibrahimhajjaj it would be good if you and @DiaaNoon could collaborate and come up with a unified approach.
DiaaEddin commentedon May 9, 2026
@ibrahimhajjaj could you share your fork? Happy to work together on this on #11079. Regarding cursor, it was left out of this PR intentionally per Mitchell's preference in the 2024 discussion on #1442, and will be addressed in follow-up work. wdyt?
ibrahimhajjaj commentedon May 10, 2026
@DiaaEddin fork's at https://github.com/ibrahimhajjaj/ghostty
four stacked branches:
itijah is yours and it's the dep under both stacks, glad it exists. the architectural difference is mostly where the visual reorder happens. your run iterator emits visual order, mine keeps the iterator logical and does logToVis at the renderer. mine has the ltr fast path. tested on macos arm with al-fatihah verses, lam-alef, mixed latin/arabic, right-justify all working.
i'll leave the two stacks parallel and let mitchell pick the architecture when he gets to it. wdyt?
re cursor: keeping it on its own branch as v2 since you confirmed mitchell scoped it out. not bundling it into v1.
DiaaEddin commentedon May 17, 2026
Thanks for sharing the branches. Went through them, really nice work.
A few notes from comparing the approaches: the shaper side handles mark anchoring a bit differently. Your branch mirrors clusters, while #11079 tracks per-cluster anchors. Your LTR fast path was a good idea too; I added the same general optimization at the itijah layer in 0.2.1 via
hasStrongRtland an allocation-free pre-scan insidegetParEmbeddingLevels, so callers can benefit without each integration adding its own check.Parallel stacks sound fine to me; that gives Mitchell both shapes to compare when he gets to it. Your cursor-selection and rtl-justify branches cover exactly the terminal-side scope deferred from #11079. Happy to look at collaborating on those follow-ups once #11079 lands.
Saiaf25 commentedon Jun 1, 2026
I’m seeing the same issue with Arabic in Ghostty: Arabic should render right-to-left, but it is currently displayed left-to-right / in the wrong visual order.
This makes Arabic command output, filenames, and Arabic text in terminal apps difficult to read. Other terminals such as Terminal.app render the same Arabic text correctly, so this appears to be the RTL/BiDi terminal-surface issue tracked here.
Adding this as another Arabic-language data point and to ask that proper RTL/BiDi support be prioritized.
refactor!: rename to Dekho Suno Jaano