Fix RTL (right to left) support for Persian & Arabic text in the Ubuntu Linux Terminal
By default, Ubuntu Linux terminal present Persian and Arabic text in reverse order and all characters separated from others.
To fix this issue, follow this steps:
1- Install required libraries by issuing this command:
sudo apt-get install libfribidi0 libfribidi-dev
2- Download bicon (BiDi Console) package for your Linux:
x64: https://launchpad.net/~aelmahmoudy/+archive/ubuntu/ppa/+files/bicon_0.5-1~1.gbp84b161_amd64.deb
x86: https://launchpad.net/~aelmahmoudy/+archive/ubuntu/ppa/+files/bicon_0.5-1~1.gbp84b161_i386.deb
For get new package updates, visit follow link:
https://launchpad.net/~aelmahmoudy/+archive/ubuntu/ppa/+packages
Attention: Never install i386 package on x64 !
3- Install .deb package via issuing this command:
for x86 i386 systems:
sudo dpkg -i bicon_0.5-1~1.gbp84b161_i386.deb
for x86 64 systems:
sudo dpkg -i bicon_0.5-1~1.gbp84b161_amd64.deb
If you received any error for additional dependent packages, simply run sudo apt-get install -f for automatically repair dependencies.
4- At the end, add follow text at the end of ~/.bashrc file:
#Correct Persian,Arabic Text Direction in Terminal
if ! [[ "$(ps -p $(ps -p $(echo $$) -o ppid=) -o comm=)" =~ 'bicon'* ]]; then
bicon.bin
fi
5- Change your Terminal Font to Dejavu Sans Mono Book in Terminal Preferences
Do not worry If you didn't have above font. You can install it by use follow command:
sudo apt install fonts-dejavu-core
6- Log-off and Log-in again into your Ubuntu Linux OS, then open terminal and see result by typing complex Persian and English text or run regular commands like ll, cal or date
- ۹۷/۰۳/۰۶