In our previous guide on Bash, ZSH, Hyper Terminal on Windows 10 setup we we almost closer to Mac’s iTerm. The next guide was on installing Python from that bash in unix style. Installing Powerline Fonts on Windows 10 Needed To Show Glyphs Properly. Here is How to Install Powerline Fonts, Symbols for Bash on Windows 10. This part often improperly written in most guides. It is very difficult unless both UNIX and Windows system is known. I am no way master of both system but this guide will definitely help you.
This guide will help to get rid off troubles like odd []
like glyphs on either Ubuntu Bash or Hyper Terminal. What is this Powerline? You better look at our old guide on how to install Powerline on Mac. It was basically a ZSH (Oh-My-ZSH) for iTerm2 like beautiful Terminal of Mac. Slowly the thing became for GNU/Linux, Windows 10 computers as all now have unix like part. It is for decoration purpose. As because most of the Windows 10 portable computers has pathetic display, the end result of color output is not exactly like Mac or having a great 4K display. This is what you’ll get end of this tutorial :
Click here for full sized screenshot.
---
How to Install Powerline Fonts, Symbols for Bash on Windows 10
You need Python, pip to have installed on the system. Our old guide on installing Python from that bash in unix style is correct step. I am going to the details of Font installation part on Windows 10 environment as second part as many readers basically can not configure the setup to use so powerful font.
Next we need to run some commands to install few things :
1 | sudo apt-get install python-fontforge python-pip python-dev libfreetype6-dev fonts-powerline |
Then you need to install this Powrline shell like Linux :
1 | https://github.com/b-ryan/powerline-shell |
Run these commands to install the latest build (instead, you can use pip as written in their document) :
1 2 3 4 5 6 | cd ~ mkdir src cd src git clone https://github.com/banga/powerline-shell cd powerline-shell python setup.py install |
Add the following to your .bashrc
:
1 2 3 4 5 6 7 | function _update_ps1() { PS1="$(powerline-shell $?)" } if [ "$TERM" != "linux" ]; then PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" fi |
Add the following to your .zshrc
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | function powerline_precmd() { PS1="$(powerline-shell --shell zsh $?)" } function install_powerline_precmd() { for s in "${precmd_functions[@]}"; do if [ "$s" = "powerline_precmd" ]; then return fi done precmd_functions+=(powerline_precmd) } if [ "$TERM" != "linux" ]; then install_powerline_precmd fi |
Next reload them :
1 2 | source ~/.zshrc source ~/.bashrc |
Although we installed Powerline Font via aptitude
above, we actually need to follow the git clone way :
1 2 3 4 5 6 | # https://github.com/powerline/fonts cd ~ git clone https://github.com/powerline/fonts.git --depth=1 # install cd fonts ./install.sh |
Now the fun is that, you need to open Windows Explorer to go to that fonts directory (although technically you can git clone somewhere else to do these steps, it gave me huge fun). Copy-paste the location on Windows Explorer and hit Enter :
1 | %localappdata%lxsshome |
You’ll be at your username directory. Go one level up to lxss
directory. You’ll find the root
directory. If that root
was you, then under root
you’ll find the cloned Fonts directory. Inside that Fonts directory there will be Install
Windows PowerShell Script (which will appear on Bash as install.psl
).
Right click on that Install
Windows PowerShell Script and run it. It will peculiarly get installed evoking lot of Windows. It is basically for filling the gap in between Linux and Windows.
Now, on Bash windows, right-click to get Properties menu and go to Fonts settings. Select some font like DejaVu Sans Mono for Powerline with Font size around 16.
Now, open Hyper Terminal, go to Edit > Preferences. Change the font, font size there too, like this an example :
// default font size in pixels for all tabs
fontSize: 18,
// font family with optional fallbacks
fontFamily: ‘Inconsolata for Powerline’, font there too :
1 2 3 4 5 | Now you can install this ZSH theme : <pre> # https://github.com/bhilburn/powerlevel9k git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k |
Open ~/.zshrc
and change/add these :
1 2 3 4 | ZSH_THEME="powerlevel9k/powerlevel9k" POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( ) |
The above POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( )
is my own choice. You can look at official guide, which will be :
1 2 | POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time) |
Now reload ZSH :
1 | source ~/.zshrc |
Re-launch the applications, you should get setup like mine.
Tagged With powerline fonts , powerline font , powerline fonts windows , powerline symbols , powerline fonts windows 10 , install powerline fonts windows , windows terminal powerline , powerline fonts windows terminal , powerline font for windows , install powerline fonts windows 10