DEV Community

Cover image for Making Powerline Work In Visual Studio Code Terminal
Matty Stratton
Matty Stratton

Posted on

Making Powerline Work In Visual Studio Code Terminal

As I mentioned in a previous post, I'm totally digging on the embedded terminal in Visual Studio Code. However, as I also mentioned, it wasn't properly representing my powerline prompt.

zsh prompt in VS Code

zsh prompt in iTerm

I solved the problem today - in case you are having a similar issue, it's a pretty easy fix. Granted, I've only proven this out on OS X, but I believe a similar solution would apply on Windows or Linux.

  1. Download proper patched font - https://github.com/abertsch/Menlo-for-Powerline
  2. In your User Settings (Code | Preferences | Settings) add this:
{
"terminal.integrated.fontFamily": "Menlo for Powerline",
}
Enter fullscreen mode Exit fullscreen mode

Tadah! My prompt in Code now looks right!

(Yes, the colors look different than the previous screenshot; since taking those screenshots I changed from using the powerlevel9k oh-my-zsh theme to instead use powerline-go.)

Top comments (40)

Collapse
 
webdevfarhan profile image
Farhan Madani

In my case, i was struggling for proper step by step solution for ubuntu 18, so i am writing what worked for me:

  1. Download this font github.com/ryanoasis/nerd-fonts/re... . Create a folder named "Meslo" and extract all the fonts inside it.
  2. Move this folder to /usr/share/fonts/truetype/
  3. Run this command sudo fc-cache -vf /usr/share/fonts/
  4. In settings.json of vscode add this line "terminal.integrated.fontFamily": "MesloLGM Nerd Font",
  5. Save and Restart if necessary, it should work. Done.

Type fc-list | grep -i "meslo" to know the names of other fonts so you can use other fonts in the terminal.

Collapse
 
sanchezpepe profile image
José Sánchez

Thank you! Working in elementary OS 5.1.3 Hera

Collapse
 
mapfumo profile image
Antony Mapfumo

Thanks. This works for Manjaro 20.0.1

Collapse
 
emmanuelnk profile image
Emmanuel K

Thank you so much! This was bugging me for hours and you also helped me solve an issue I had with Gogh in the same way.

Collapse
 
vdvcoder profile image
Olivier

This works for Ubuntu 18.04. Thank you!

Collapse
 
drishtantr1508 profile image
Drishtant Rai

You are a life saviour , Thanks worked for me on ubuntu 21.04 which is latest ubuntu till now.

Collapse
 
nadir24950 profile image
Belmokhtar Nadir

Hello
Ubuntu 20 and latest vscode as of 05/2021, powerline10k
I have tried these instructions and i haven't been able to fix the issue.

Collapse
 
biowulf21 profile image
James J

What an absolute legend. Thanks, King

Collapse
 
niksingh710 profile image
Nikhil Singh

I had searched the whole internet but it worked by your tutorial. Thanks a lot.

Collapse
 
revoltez profile image
revoltez • Edited

beautiful , thanks that saved me hours !! working in linux mint 19.1

Collapse
 
melgio profile image
melgio

this works - arch linux 5.15.4-arch1-1

Collapse
 
fikimaulana profile image
Fiki Maulana

Thank you. This works on my vscode manjaro 20.2. :)

Collapse
 
nishantk290195 profile image
Nishant Kumar

Thanks mate

Collapse
 
khuzha profile image
Sardorkhuja Tukhtakhodjaev

thanks! I installed in /Users/username/Library/Fonts on mac os and it works for me

Collapse
 
ilq profile image
Lazarev iLya

When I add "Menlo for Powerline" in settings, VSCode say "The terminal only supports monospace fonts."

Collapse
 
icefire1 profile image
Simon Larsen

I had the same problem. What worked for me was setting "terminal.integrated.fontFamily": "Menlo for Powerline" and restarting Visual Studio Code. Making sure not to press the "monospace" dialog that Visual Studio Code presents as this would set "terminal.integrated.fontFamily": "monospace"

Collapse
 
dolemoine profile image
dolemoine

Thx! I was facing the same issue and restarting vscode after setting "terminal.integrated.fontFamilly" to "Menlo for Powerline" solve the problem as the popup dialog wouldn't show anymore!

Collapse
 
puchkii profile image
Kevin Blank

What can i do if i have pressed monospace dialog? ive set the terminal.integrated fontFamily to Menlo for Powerline but it still doesnt work....

Thread Thread
 
icefire1 profile image
Simon Larsen

It's been a while now. But ensure the settings remains between VScode reboots. Personally I am currently using "MesloLGM Nerd Font" instead

Thread Thread
 
ismlynx profile image
Ismael Amaral

My VSCode now works fine with zsh. Thank you.

Collapse
 
mattstratton profile image
Matty Stratton

Hmm. I just tried this again (on a recently updated VS Code) and it worked for me. This is on OS X; what OS are you on?

Collapse
 
ilq profile image
Lazarev iLya

Ubuntu

Thread Thread
 
scaratec profile image
Randy Gupta

I have the very same issue here and I can't get the powerline fonts working on VS code with ubuntu.

:-(

Thread Thread
 
ilq profile image
Lazarev iLya

Try setting: "terminal.integrated.fontFamily": "monospace",

Thread Thread
 
servatj profile image
Josep • Edited

still not working...

Edited: My Solution.

instead of moving the font file to hidden folder .fonts in user home do this in ubuntu

sudo mv Menlo\ for\ Powerline.ttf /usr/share/fonts/

then sudo fc-cache -vf /usr/share/fonts/

I'm using ubuntu 18.04 at the moment of writting this, hope it helps.

Thread Thread
 
dzintars profile image
Dzintars Klavins

Works for Fedora 30 as well!. Tnx.

Collapse
 
seanny123 profile image
Sean Aubin

Here is the script I used to get the fonts working for Fedora:

cd /tmp
git clone git@github.com:abertsch/Menlo-for-Powerline.git
cd Menlo-for-Powerline/
mkdir ~/.fonts
cp *.ttf ~/.fonts/
fc-cache -vf ~/.fonts
Enter fullscreen mode Exit fullscreen mode

After running these commands, you still need to update your Visual Studio Code settings.

Collapse
 
joelsgp profile image
jmcb

You can fix the symbols without changing your general terminal font. The settings key terminal.integrated.fontFamily allows a comma separated list of families. I copied the default list ("editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace"), then inserted my symbols font family. I'm on arch and I installed the powerline-fonts package, so the result is "terminal.integrated.fontFamily": "'Droid Sans Mono', 'PowerlineSymbols', 'monospace', monospace".

Collapse
 
yellowfoxh4xor profile image
Akshat katiyar

I guess we dont have to download new fonts for this purpose.
Just use the exisiting iTerm font

{
"terminal.integrated.fontFamily": "same font name as iTerm",
}

example - 'MesloLGS Nerd Font'

Collapse
 
razmikarm profile image
Razmik Poghosyan


"terminal.integrated.fontFamily": "monospace, PowerlineSymbols"

worked for me. Fedora 35

Collapse
 
ninjeneer profile image
Ninjeneer

Perfect, much faster than other solutions in the comments, thanks !

Collapse
 
odedbaruch profile image
OdedBaruch

awesome !!!

Collapse
 
ankyitm profile image
Ankit Mehta • Edited

If it does not work then make sure to put fonts name within single quotes. cln.sh/CceAhd

Collapse
 
evertonlopesc profile image
Everton Lopes

In my case, I use Manjaro. I used the font "'Hack Nerd Font'". (e.g: " ' ' ").

Collapse
 
m4l490n profile image
Manuel Malagon

Awesome!! This one worked for me!

Collapse
 
vsfountain profile image
vsfountain

clutch

Collapse
 
bonstine profile image
Bonnie Simon

I am using JetBrains Mono. But I can't seem to get the powerline fonts working. What can I do?

Collapse
 
berkmann18 profile image
Maximilian Berkmann

Straightforward and helpful. Thank you!

Collapse
 
p4t0n1x profile image
Salvador Gudino • Edited

Excellent helpfully info, thank you very much!

Collapse
 
ksprashu profile image
Prashanth K S • Edited

Thank you. Having to type in the font family was what tripped me up all these days. I was trying to find the right "key" for this setting.