Closed thawk closed 5 years ago
I've fixed this bug in Powerlevel10k in a portable way: https://github.com/romkatv/powerlevel10k/blob/b404c1b54e5c0e0ce978e4839c828171178ee824/internal/p10k.zsh#L2673. Feel free to backport the fix to Powerlevel9k.
(I usually open an issue against Powerlevel9k for every bug that I fix in Powerlevel10k but this time apparently I forgot to do so.)
@romkatv has a better, OS independent solution. Thx.
Description
In FreeBSD (My version is
FreeBSD 11.2
),tput colors
is the same astput co
, it returns the number of columns instead of the number of colors.tput Co
returns the number of colors.But in other OS, like my MacBook,
tput Co
failed to be executed. So some kind OS based logic has to be introduced to use difference terminfo capability at difference OS.This PR use
tput Co
for and only for FreeBSD, use originaltput colors
otherwise.