Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font issues while integrating ZSH on Visual Studio Code

I'm trying to integrate zsh on my VSC setup but apparently arrows are not recognized by it.

enter image description here

My zsh theme is agnoster and I've already tried adding "terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline" with no success. Anyone experienced something like this and can give me a hand? Thanks.

like image 381
Barnercart Avatar asked Jul 03 '20 07:07

Barnercart


People also ask

How do you change the font on zsh?

To change font in the Core Shell on your Mac, choose Core Shell > Preferences, then click General and choose a built-in font from the font panel.

How do I add a nerd font to VSCode terminal?

You can change the terminal font setting for VS Code and use a Nerd Font as suggested in Starship's documentation. To do that either go to the settings and search for Terminal Font and update the value or you can add this to your settings. json . "terminal.


2 Answers

Following this little guide solved the issue making-powerline-work-in-visual-studio-code-terminal.

IMPORTANT: if you already have a powerline font installed (e.g. it looks fine inside your system terminal), skip step 1.

  1. Install a patched version of your desired font directly from https://github.com/powerline/fonts. Apparently doing the "quick installation" (e.g. sudo apt-get install fonts-powerline) does not work in this case. So you can install manually downloading the .ttf file directly or running the install script ./install.sh provided. For instance you can do the following:

    1. Clone the repository:

      git clone https://github.com/powerline/fonts && cd fonts
      
    2. Run ./install.sh to install them all or install one specific font by going inside its directory and opening the .ttf file. For instance, manually installing DejaVu Sans Mono for Powerline:

      • cd DejaVuSansMono
      • Open DejaVu Sans Mono for Powerline.ttf
      • Install the font
  2. Add the terminal.integrated.fontFamily to your User Settings settings.json in VSCode specifying the powerline font to use. For instance, if I want to use DejaVu Sans Mono for Powerline:

    {
        [...]
        "terminal.integrated.fontFamily": "DejaVu Sans Mono for Powerline",
        [...]   
    }
    
  3. Restart Visual Studio Code

like image 174
Barnercart Avatar answered Oct 01 '22 03:10

Barnercart


For me it worked for linux and as well as manjaro (i don't know why others solution weren't working for me).

Download this font download font from here , Then create a folder named "Meslo" and extract all the fonts inside it.
Move this folder to /usr/share/fonts/truetype/
Run this command:

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

In settings.json of vscode add this line:

"terminal.integrated.fontFamily": "MesloLGM Nerd Font"

Save and Restart if necessary, it should work. Done.

like image 45
chandan kumar Avatar answered Oct 01 '22 02:10

chandan kumar