Bash Prompt – How to Get Arrow Style Bash Prompt After Installing Powerline?

bashbashrccolorspromptUbuntu

I have installed powerline. But my prompt looks like so instead of arrow shaped:

enter image description here

In vim, it looks ok:

enter image description here

I have seen the issue here: https://github.com/powerline/powerline/issues/1697. But the solution there doesn't work for me.

There is a similar question but his question was to achieve it without installing powerline here: https://stackoverflow.com/questions/32443522/triangular-background-for-bash-ps1-prompt

I am using Ubuntu 16.04. How do I get it right?

Edit: I have tried the following ways:

1) Used powerline fonts but made no difference.

2) Installation was done using pip3. It was installed under python3.5 directory. Since it is not giving the desired result, I have uninstalled and installed it using pip. But the installation directory remained same i.e. python3.5 and the result also remained the same. I then tried installing with python2.7 -m pip install powerline-status and it installed under python2.7 directory and it resulted in the same.

Best Answer

I have fixed it by reconfiguring my locale.

I ran locale and it gave me this:

$ locale
LANG=en_IN.UTF-8
LANGUAGE=en_IN:en
LC_CTYPE="en_IN.UTF-8"
LC_NUMERIC="en_IN.UTF-8"
LC_TIME="en_IN.UTF-8"
LC_COLLATE="en_IN.UTF-8"
LC_MONETARY="en_IN.UTF-8"
LC_MESSAGES="en_IN.UTF-8"
LC_PAPER="en_IN.UTF-8"
LC_NAME="en_IN.UTF-8"
LC_ADDRESS="en_IN.UTF-8"
LC_TELEPHONE="en_IN.UTF-8"
LC_MEASUREMENT="en_IN.UTF-8"
LC_IDENTIFICATION="en_IN.UTF-8"
LC_ALL=

So I tried to set the following in .bashrc, but it didn't work:

export LANGUAGE=en_US.UTF-8   
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

So I ran the following and restarted the PC(Logging out wasn't enough):

sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales

In the first configuration menu, I have deselected the en_IN... using spacebar and in next menu, I have selected en_US.UTF-8. After this locale showed all en_US.

Instead of all this, probably just setting LANUAGE and LANG to en_US in /etc/default/locale could have been enough? Idk

Related Question