oh my zsh showing weird character '?' on terminal

I have installed iTerm2 and Oh-my-zsh. However there is a weird question mark that is coming ever since I have changed ZSH-THEME to "agnoster".

Attaching the screenshot for the same.

check the question mark on terminal pointer

I thought powerline would help but that doesn't seem to happen. Can can anyone help me with this?


Solution 1:

Run step 1-4 in your iterm2/terminal and you are done.

  1. git clone https://github.com/powerline/fonts (clone it anywhere, You can remove cloned dir after step-4)
  2. cd fonts
  3. ./install.sh
  4. Open iTerm2->Preferences->Profiles->Text->Change Font-> Meslo LG S DZ Regular for Powerline
  5. Reopen the terminal and you are done.

Edit: If you are not using iTerm you can simply change the default macOS Terminal Preferences. (Thanks to Kewal)

You can also refer this long git thread for the same.

Solution 2:

Installing a powerline patched font will solve this. This official documentation provides description about installing poweline fonts.

There are two ways to enable powerline patched font in iTerm2.

  1. Set a powerline patched font as default.

One defauls font

  1. Set a powerline patched font for only Non-ASCII characters and use another font for code.

Different fonts

Bonus:

  • Collection of powerline patched fonts
  • Awesome oh-my-zsh themes
    • Spaceship ZSH
    • Buller Train
    • powerlevel9k