Skip to content

Instantly share code, notes, and snippets.

@480
Last active November 20, 2024 06:57
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.
@umartinez22
Copy link

Awesome, work fine.

@gcagle3
Copy link

gcagle3 commented Apr 2, 2021

This is an awesome guide, thank you! Wanted to add that I like using the following font to match my iterm2 setup:

"terminal.integrated.fontFamily": "Inconsolata for Powerline",

@iynga
Copy link

iynga commented Apr 13, 2021

"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'",
"terminal.integrated.rendererType": "canvas",
"terminal.integrated.fontSize": 12,
"terminal.integrated.lineHeight": 1.1

works like a charm!

@HackintoshwithUbuntu
Copy link

"terminal.integrated.rendererType": "canvas"
works with powerline10k and "terminal.integrated.fontFamily": "MesloLGS NF"

@flakrat
Copy link

flakrat commented May 26, 2021

Thanks so much to all for posting these. Prompt now looks great with

{
    "terminal.integrated.fontFamily": "Hack Nerd Font",
    "terminal.integrated.automationShell.osx": "/usr/local/bin/zsh",

@Sharkrit
Copy link

"terminal.integrated.fontFamily": "Hack Nerd Font" works like a charm.

Same here ^_^

@iammeizu
Copy link

iammeizu commented Jul 6, 2021

work for me!

@luamintw
Copy link

emm.. Setting the font to "MesloLGS NF" works for me rather than "Hack Nerd Font"

Visual Studio Code: Open File → Preferences → Settings, enter terminal.integrated.fontFamily in the search box and set the value to MesloLGS NF.

@Orrimp
Copy link

Orrimp commented Sep 8, 2021

"terminal.integrated.fontFamily": "'Source Code Pro for Powerline', 'Hack Nerd Font'"

Worked for me to display symbols (git)

@tzaffi
Copy link

tzaffi commented Nov 18, 2021

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

That's all I needed to add with powerline!

@ZedWang1874
Copy link

Works perfectly for me! Thanks a lot!

@vtwang
Copy link

vtwang commented Mar 25, 2022

On vscode ver 1.64 "terminal.integrated.shell.osx": "/bin/zsh" will cause the following error message in settings.json

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in Terminal › Integrated › Profiles: Osx and setting its profile name as the default in Terminal › Integrated › Default Profile: Osx. This will currently take priority over the new profiles settings but that will change in the future.

"terminal.integrated.defaultProfile.osx": "zsh" addresses the deprecation warning

@480
Copy link
Author

480 commented Mar 26, 2022

@vtwang Thank you much. It has been updated to document.

@ansund
Copy link

ansund commented May 5, 2022

I'm having problem getting the colors in vs code to look like Iterm. Anyone else haveing this problem?
I went form powerlin 9 to powerline 10.

@fonzane
Copy link

fonzane commented May 12, 2022

vs code says to me that terminal.integrated.renderType is an unknown configuration setting. I can't get it to work properly with "terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'", ...
Bildschirmfoto 2022-05-12 um 15 10 53
Does someone have an idea how to fix this?

@480
Copy link
Author

480 commented May 16, 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

@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