How to get the arrow style bash prompt after installing powerline?
Solution 1
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
Solution 2
Install powerline fonts by cloning the repo (I'm cloning to a dir in home)
git clone https://github.com/powerline/fonts ~/powerline_fonts
Then link your desired font to your standard font directory. For example, if you've cloned the repo to a directory named powerline_fonts
in your home, you'd use a command something like this.
ln -s ~/powerline_fonts/Anonymous\ Powerline.ttf ~/.local/share/fonts/
Set the preference of the terminal to use one of the powerline font such as "Anonymous for Powerline"
Now you should see the arrow shaped glyph.
Powerline uses special glyphs embedded in a font to render those nifty icons. So, you need a font that has those glyphs. Fortunately you can patch a font or use some already patched fonts like the ones from the repo I referenced earlier.
Related videos on Youtube
Community
Updated on September 18, 2022Comments
-
Community over 1 year
I have installed powerline. But my prompt looks like so instead of arrow shaped:
In vim, it looks ok:
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.-
Michael D. about 7 yearsIs your terminal using a powerline font?
-
Admin about 7 yearsYes I have installed powerline fonts. Specifically, I am using the source code pro for powerline.
-
JdeBP about 7 yearsThere was a more similar question on this stack exchange site at unix.stackexchange.com/questions/320735 .
-
Admin about 7 yearsIf you are suggesting to use patched fonts for powerline, yes I have tried that and they seem to make no difference for me. Also it seems he did not install powerline in the first place
-
-
Admin about 7 yearsI have already installed powerline fonts and specifically using the source code pro for powerline in terminal. But I still don't get the arrow shape.
-
Anwar about 7 years@vikramreddym Make sure you're using the right profile. There can be multiple profiles for a given terminal. Which terminal are you using?
-
Admin about 7 yearsIt's a Gnome terminal I think. The default one on Ubuntu. I see that there is only one unamed profile in terminal preferences.
-
Anwar about 7 yearsDid you set the font in profile? Which version it is?
-
Admin about 7 yearsHello, yes I have set the font in the profile preferences. I have set it as "Source code pro for powerline regular" It's Gnome Terminal 3.18.3
-
Anwar about 7 years@vikramreddym I know this may seems weird, but did you check the "Custom Font" is enabled in Terminal Profile preference? Also give the output of
fc-match "Source Code Pro for Powerline"
-
Admin about 7 yearsYes I have the custom font ticked. I get this output
Sauce Code Powerline Regular.otf: "Source Code Pro for Powerline" "Regular"
-
Anwar about 7 yearsLet us continue this discussion in chat.
-
AniketGM over 4 yearsThat's what I was looking for. Thanks a lot!
-
lyarwood almost 4 yearsFWIW you should just use the provided install.sh to install from the repo.
git clone https://github.com/powerline/fonts ~/powerline_fonts && cd ~/powerline_fonts && ./install.sh
-
badola over 3 yearsThis is what worked for me in
Ubuntu 20.04
as well. By default, the locale was set toen_IN
on my system.