Esta fonte diz para verificar se $COLORTERM contém 24bit ou truecolor .
sh
[ "$COLORTERM" = truecolor ] || [ "$COLORTERM" = 24bit ]
bash / zsh :
[[ $COLORTERM =~ ^(truecolor|24bit)$ ]]
Em um script de shell, como posso testar se o terminal suporta cores de 24 bits ou cores verdadeiras?
Relacionados: Esta questão é sobre imprimir um arquivo de 24 bits Padrão de teste / truecolor para verificação do globo ocular
Esta fonte diz para verificar se $COLORTERM contém 24bit ou truecolor .
sh [ "$COLORTERM" = truecolor ] || [ "$COLORTERM" = 24bit ]
bash / zsh : [[ $COLORTERM =~ ^(truecolor|24bit)$ ]]