Question Marks in iTerm (Font Issue?)
I recently set up my iTerm and have been really enjoying how smooth and functional it is out of the box. I installed the Prezto zsh pre-config and set up Powerlevel10k as my Prezto theme. I also use solarized dark with Inconsolata for Powerline and Menlo for Powerline as my font, both of which have this issue.
When I cd to my root director (cd /), I see an odd question mark box on my powerline. I also see the same box when I activate my virtualenv in a python code directory.
Below is a picture of this happening with the root directory. When I activate the virtualenv, the same thing happens but ON THE RIGHT SIDE beside an indicator with my project name that comes up when virtualenv is activated. What do the question marks mean? What is failing to display? I have no idea what is going on and would appreciate help in troubleshooting.
After a period of troubleshooting, and with some nudges from Allan, I was able to figure out what was going on: my terminal was attempting to display a unicode lock.
Turns out, my font, Inconsolata for Powerline, didn't support this. I came to this conclusion after reverting to my default theme in iTerm2 WITHOUT Inconsolata enabled. The lock displayed correctly there!
After research, I found a Github repo (and its name is familiar... I feel like I used it on a previous install) of patched fonts that display most of the proper terminal unicode icons. Much thanks to ryanoasis on Github for this!
If you're having a similar problem like me, give it a try and see how it goes. Here's what the fixed terminal looks like:
What your screenshot shows is Zsh prompt defined by Powerlevel10k. Powerlevel10k is flexible w.r.t. what symbols it uses to communicate information. As long as it knows the capabilities of your terminal and font, it'll stick to symbols that can be rendered correctly. On the screenshot Powerlevel10k displays a question mark because it thinks your terminal can display it. This usually happens when you configure Powerlevel10k in one terminal with one font, and then use the same config either in a different terminal or with a different font.
Whenever you change your terminal or terminal font, you need to run p10k configure
. If you aren't yet using the recommended font, the configuration wizard will ask whether you want to install it. For best experience, say "Yes", restart iTerm2 when prompted and then run p10k configure
again. You may, however, refuse to install the font and proceed with prompt configuration. Powerlevel10k will still work but the choice of prompt styles will be limited if your current font isn't very capable.
The question mark in a box is placeholder for a symbol from a font set it doesn't recognize.
There are probably pre-requisites and/or dependencies for Prezto and the Powerlevel10k themes (maybe even the solarized theme as well) that didn't get installed. You can try reinstalling and watch for errors to see what does/doesn't get installed.
At minimum, we need to see your .zprofile and/or .zshrc files to see what modifications were made to your prompt and then possibly try to decipher which Unicode symbol the theme was going for.
And not trying to be a negative Nelly here, I believe this needs to be said: This is one of the issues I have with all these ZSH theme and customization packs. Yes, they're cool and all, but most people have difficulty working in a shell to begin with. Now, let's add a whole bunch of complex stuff to files the user isn't familiar with either and hope for the best.
The best piece of advice I can give is to try to understand your shell, as it is it it's native form before you start trying to make it look cool with scripts and customization found all over the Internet. Why? Do you really (no, I mean really) know what that customization is doing to your computer? How can you be sure you didn't just install a backdoor to your machine?