Percent characters printed when using powerlevel10k zsh theme
Some wierd percent characters are printed to the console when using the zsh theme powerlevel10k:
The wierd thing is that this seems to be performance-related. When using individual
foot processes, the issue is always present. However, in the client-server architecture, the the first
footclient window always have the issue, but it is random for the subsequent
footclient windows: if I keep spawning serveral windows at once (by keeping
mod+Enter pressed), then most of the windows will have the issue, but if I spawn the
footclient windows with enough delay, then only the first one will have, and the subsequent one probably won't.
I've tried various powerlevel10k configurations, and the issue is present with all of them, including the simplest ones. I've even tried disabling the instant prompt, but there doesn't seem to be any effect.
These characters are not printed in any of the other terminals that I have installed: kitty, alacritty, terminator, gnome-terminal.
This is actually not related to the powerlevel10k theme; it's a generic zsh issue. It's a timing issue, and has to do with how zsh responds to window resize events.
While foot is launching, it is possible for the shell to observe (by polling, or through
SIGWINCH signals) multiple window sizes:
- The first size is a hardcoded 80x24 chars grid. This is before the window has been displayed, or even created.
- Next, assuming you're running Sway at least, the compositor asks us to size the window. This is still before the window is visible. Here, foot will use the configured
- After finally becoming visible, Sway immediately asks us to resize ourselves to the final size.
This quick succession of size changes can trigger racy behavior in client applications. Foot is not the only terminal that exhibits this (search Alacritty's issue tracker and you'll find several reports).
It may be slightly more inclined to show this behavior though, since it is pretty aggressive about spawning the shell process as early as possible. This is to reduce startup time.
Related (probably at least) issue for a different shell: #195
While I can't say for sure what the '%' characters are, my guess would be that they are related to the shell redrawing its prompt.
I would like to add this that I've been using
foot as my main and only terminal since December, and never actually noticed this issue in practice. I think it was only manifested while testing and not an issue at all in real life.
Now that I'm here, I would like to add that
foot is a great terminal, and I'm loving it. @dnkl keep up the good work!
Deleting a branch is permanent. It CANNOT be undone. Continue?