I know that emacs supports Arabic and I have seen many questions on Arabic support but my problem here is specifically with emacs in the terminal.
It can be seen in the image bellow in the left side that the text is shown correctly in the GUI mode. However the problems appear in the terminal in the middle and right frames of the screenshot.
In the middle one, it is just emacs running normally from the terminal. Here the letters are shown in the correct order from right to left but the problem is that the letters are separated.
A classical solution to problems with Arabic in the terminal is BiCon. It works pretty well with programs that are not aware of right to left languages.
In the right of the image emacs can be seen running under BiCon. The letters here are connected, which is good, but it is in the reversed order. I Believe that this is because emacs is already taking care of order and then BiCon is reversing it back.
One last thing to mention is that I tried some different terminals including xterm, gnome-terminal, konsole, and mlterm.
Any suggestions?
UPDATE:
This is not really a solution but it's workaround.. Using python-arabic-reshaper save this as ar-reshaper.py:
import arabic_reshaper
import sys
for line in sys.stdin:
sys.stdout.write(arabic_reshaper.reshape(line))
Then:
cat INPUTFILE | python3 ar-reshaper.py > OUTPUTFILE
The OUTPUTFILE will be the reshaped version of INPUTFILE with the connected Arabic letters and the result on emacs:
But still, an actual solution is needed...
UPDATE:
Reported as bug and here's a little minor-mode if anyone is interested
BiCon
is handling direction for you, then try using(setq-default bidi-display-reordering nil)
to disable that in Emacs. See alsoC-h i g (emacs)Bidirectional Editing
M-x report-emacs-bug
and describing the nature of the problem and how you fixed it?