Terminal environments are always awful at RTL, they always need to make shitty compromises that graphical environments just don’t need to make. The fact that you even need a RTL mark is already a bad start - graphical text renderers can deduce text directionality based on the characters in it.
https://en.m.wikipedia.org/wiki/Right-to-left_mark
It’s just a Unicode character; Copy-Paste and experiment!
(If you’d like more direction on how to play with this in a *NIX terminal let me know.)
Terminal environments are always awful at RTL, they always need to make shitty compromises that graphical environments just don’t need to make. The fact that you even need a RTL mark is already a bad start - graphical text renderers can deduce text directionality based on the characters in it.