Skip to content

Instantly share code, notes, and snippets.

@480
Last active April 11, 2024 23:56
Show Gist options
  • Save 480/3b41f449686a089f34edb45d00672f28 to your computer and use it in GitHub Desktop.
Save 480/3b41f449686a089f34edb45d00672f28 to your computer and use it in GitHub Desktop.
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install powerline fonts

https://github.com/powerline/fonts

or Install Nerd Fonts. (If you don't use powerline fonts)

https://www.nerdfonts.com/font-downloads

recommend font: Hack Nerd Font https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip

Change settings for vscode

How?

  1. open vscode
  2. open Command Pallete (Short Cut: F1)
  3. type settings and Select Preferences: Open Settings (JSON)
  4. Add or Edit below settings to Settings JSON file
  5. Save.
  6. That's all

ps. This JSON type is JSON with Comments, so you can use comment syntax in it.

"terminal.integrated.fontFamily": "Source Code Pro for Powerline",
// @vtwang added (deprecated)
// "terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.defaultProfile.osx": "zsh",

// @jasonekratz added
// This fixed the glyph issues I was having with Inconsolata Nerd Font.
"terminal.integrated.gpuAcceleration": "canvas",

// @Drakal added
// I'd also consider adjusting line height if icons are cut off on top too or things look super cramped.
// "terminal.integrated.lineHeight": 1.3

// @ChongTang, @ramonsantos added
// @gaochundong said it works like a charm.
// "terminal.integrated.fontFamily": "Hack Nerd Font"

// @dalekurt added (belows which gives me the the fonts for the terminal and the icons from Nerd Font.)
// "terminal.integrated.fontFamily": "'Source Code Pro for Powerline', 'Hack Nerd Font'

// @nickhingston , @olivebay added for powerlevel10k
// I use powerline10k - which uses https://github.com/romkatv/powerlevel10k/#recommended-meslo-nerd-font-patched-for-powerlevel10k
// so this worked for me:
// "terminal.integrated.fontFamily": "MesloLGS NF" 

// @kaustuv added
// after the changing the font, still had some issues with the glyph spacing in the integrated terminal - fixed it with 
// @ar2zee : fixed the problem for me.
// (deprecated)
// "terminal.integrated.rendererType": "canvas"

Change Theme for Mac OSX Terminal to agnoster

  1. Add DEFAULT_USER=whoami in ~/.zshrc
  2. Change Theme to agnoster in ~/.zshrc
  3. Restart Terminal or source ~/.zshrc

Download agnoster theme and set up

  1. Download https://github.com/mbadolato/iTerm2-Color-Schemes/zipball/master
  2. Unzip
  3. Open Mac Terminal
  4. CMD + , open settings
  5. on Left Sidebar, Click Config Icon and Select Import...
  6. Choose Terminal Schema: UnzipPath/terminal/*.terminal
  7. I recommend Solarized Dark.terminal
  8. then, make it default (select imported schema and click "Default" button below)
  9. That'all. if you restart terminal, you can see great agnoster theme with oh my zsh.
@fonzane
Copy link

fonzane commented May 17, 2022

@fonzane @justjeevs

Have you installed Hack Nerd Font? The terminal.integrated.renderType setting seems to deprecated.

I use terminal.integrated.fontFamily to just Hack Nerd Font. It looks like below.

image

vscode: April 2022 (version 1.67) mac: Monterey 12.3.1

Nah, that doesn't work either 🙁
Bildschirmfoto 2022-05-17 um 09 09 48

@jasonekratz
Copy link

jasonekratz commented May 18, 2022

For those having issues with the glyph rendering the correct setting is:

"terminal.integrated.gpuAcceleration": "canvas"

This fixed the glyph issues I was having with Inconsolata Nerd Font.

That said... p10k seems to have the fewest glpyh issues with their preferred font MesloLGS NF.

@fonzane
Copy link

fonzane commented May 18, 2022

For those having issues with the glyph rendering the correct setting is:

"terminal.integrated.gpuAcceleration": "canvas"

yes, this also fixed the issue for me I had with 'SourceCodePro+Powerline+Awesome Regular'
thank you! ❤️

@amitprasad119
Copy link

"terminal.integrated.fontFamily": "MesloLGS NF"

where to write this ?

@amitprasad119
Copy link

@fonzane @justjeevs
Have you installed Hack Nerd Font? The terminal.integrated.renderType setting seems to deprecated.
I use terminal.integrated.fontFamily to just Hack Nerd Font. It looks like below.
image
vscode: April 2022 (version 1.67) mac: Monterey 12.3.1

Nah, that doesn't work either 🙁 Bildschirmfoto 2022-05-17 um 09 09 48

where to make these changes

@jasonekratz
Copy link

You don't have to "write" it anywhere. These settings are all available via the settings UI in VS Code.

Screen Shot 2022-05-18 at 12 56 43 PM

Same thing for the update I mentioned for fixing the chopped off glyphs.

@gcaride
Copy link

gcaride commented May 21, 2022

For those having issues with the glyph rendering the correct setting is:

"terminal.integrated.gpuAcceleration": "canvas"

This fixed the glyph issues I was having with Inconsolata Nerd Font.

That said... p10k seems to have the fewest glpyh issues with their preferred font MesloLGS NF.

Thank youu!!!
Having the same issue and i didnt find the solution!

@mghmay
Copy link

mghmay commented May 26, 2022

"terminal.integrated.gpuAcceleration": "canvas"

Dude, you are a frigging life saver! This was annoying me so much I just spent about an hour trying to fix it until I saw your solution!

@480
Copy link
Author

480 commented May 27, 2022

@jasonekratz

I updated the gist with your comment.
You saved many people.

Thank you.

@jasonekratz
Copy link

Glad I was able to help. It was definitely annoying!

@brdacost
Copy link

brdacost commented Jun 2, 2022

Hey guys, I'm using powerlevel10k and oh-my-zsh on my curretn zsh default profile. The rendering of powerlines and glyphs seem to be working fine, but for some reason, whenever I try to run a cli command, the name of the terminal changes to this strange name (e.g. "zsh - p10k.worker.501.37096.16454196804.fifo" ) and after the name is like this, all other vscode command (like split terminal view, or create a new terminal) start throwing error messages like this one on the print ("The terminal process failed to launch [...]" ).
It is not a MAJOR issue, but it has been bugging me for a while...any tips or comments on thar are very much appreciated 😅
image

@arivvid27
Copy link

arivvid27 commented Jul 7, 2022

I think Powerline fonts installs when you install Agnoster theme with oh-my-zsh. Please correct me if I'm wrong.

@Akhil-Suresh
Copy link

worked like a charm. Thanks...

@juanpabloxk
Copy link

It worked perfectly for me, thanks a lot!

VS Code on Arch Linux. Font: Iosevka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment