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.
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.
- Download proper patched font - https://github.com/abertsch/Menlo-for-Powerline
- In your User Settings (Code | Preferences | Settings) add this:
{
"terminal.integrated.fontFamily": "Menlo for Powerline",
}
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)
In my case, i was struggling for proper step by step solution for ubuntu 18, so i am writing what worked for me:
Type fc-list | grep -i "meslo" to know the names of other fonts so you can use other fonts in the terminal.
Thank you! Working in elementary OS 5.1.3 Hera
Thanks. This works for Manjaro 20.0.1
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.
This works for Ubuntu 18.04. Thank you!
You are a life saviour , Thanks worked for me on ubuntu 21.04 which is latest ubuntu till now.
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.
What an absolute legend. Thanks, King
I had searched the whole internet but it worked by your tutorial. Thanks a lot.
beautiful , thanks that saved me hours !! working in linux mint 19.1
this works - arch linux 5.15.4-arch1-1
Thank you. This works on my vscode manjaro 20.2. :)
Thanks mate
thanks! I installed in /Users/username/Library/Fonts on mac os and it works for me
When I add "Menlo for Powerline" in settings, VSCode say "The terminal only supports monospace fonts."
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"
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!
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....
It's been a while now. But ensure the settings remains between VScode reboots. Personally I am currently using "MesloLGM Nerd Font" instead
My VSCode now works fine with zsh. Thank you.
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?
Ubuntu
I have the very same issue here and I can't get the powerline fonts working on VS code with ubuntu.
:-(
Try setting: "terminal.integrated.fontFamily": "monospace",
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.
Works for Fedora 30 as well!. Tnx.
Here is the script I used to get the fonts working for Fedora:
After running these commands, you still need to update your Visual Studio Code settings.
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 thepowerline-fonts
package, so the result is"terminal.integrated.fontFamily": "'Droid Sans Mono', 'PowerlineSymbols', 'monospace', monospace"
.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'
"terminal.integrated.fontFamily": "monospace, PowerlineSymbols"
worked for me. Fedora 35
Perfect, much faster than other solutions in the comments, thanks !
awesome !!!
If it does not work then make sure to put fonts name within single quotes. cln.sh/CceAhd
In my case, I use Manjaro. I used the font "'Hack Nerd Font'". (e.g: " ' ' ").
Awesome!! This one worked for me!
clutch
I am using JetBrains Mono. But I can't seem to get the powerline fonts working. What can I do?
Straightforward and helpful. Thank you!
Excellent helpfully info, thank you very much!
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.