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.
This is not really a solution but it's workaround.. Using python-arabic-reshaper save this as ar-reshaper.py:
for line in sys.stdin:
cat INPUTFILE | python3 ar-reshaper.py > OUTPUTFILE
But still, an actual solution is needed...
Reported as bug and here's a little minor-mode if anyone is interested