Skip to content

Instantly share code, notes, and snippets.

@480
Last active July 3, 2024 03:59
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.
@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