base prompt now supports 256 and 24 bit color
This commit is contained in:
@@ -6,25 +6,6 @@ fi
|
||||
|
||||
setopt prompt_subst
|
||||
|
||||
# color depth
|
||||
colordepth=4
|
||||
if [[ "$COLORTERM" == "truecolor" || "$COLORTERM" == "24bit" ]]; then
|
||||
colorcount=16000000
|
||||
else case $TERM in
|
||||
iterm |\
|
||||
vte* |\
|
||||
*-truecolor )
|
||||
export COLORTERM="truecolor" # environmental consistency
|
||||
colorcount=16000000
|
||||
;;
|
||||
*-256color )
|
||||
colorcount=256
|
||||
;;
|
||||
*)
|
||||
colorcount=$(tput colors | tr -d "\n")
|
||||
;;
|
||||
esac
|
||||
|
||||
kitty_available=n
|
||||
if (( ${+KITTY_SHELL_INTEGRATION} )); then
|
||||
kitty_available=y
|
||||
@@ -45,3 +26,29 @@ function ticker_message () {
|
||||
function ticker_finish () {
|
||||
[[ $_zeeshdev_ticker_newlines == 0 ]] && printf "\r${(l:$cols:: :)A}\r"
|
||||
}
|
||||
|
||||
# color depth
|
||||
colordepth=4
|
||||
if [[ $_zeeshdev_force_color_count -gt 0 ]]; then
|
||||
colorcount=$_zeeshdev_force_color_count
|
||||
ticker_message "zeesh: color count set to $colorcount (fuse blown)"
|
||||
elif [[ "$COLORTERM" == "truecolor" || "$COLORTERM" == "24bit" ]]; then
|
||||
ticker_message "zeesh: true color detected! (via COLORTERM)"
|
||||
colorcount=16000000
|
||||
else case $TERM in
|
||||
iterm |\
|
||||
vte* |\
|
||||
*-truecolor )
|
||||
export COLORTERM="truecolor" # environmental consistency
|
||||
ticker_message "zeesh: true color detected! (via TERM)"
|
||||
colorcount=16000000
|
||||
;;
|
||||
*-256color )
|
||||
ticker_message "256 colors detected (via TERM)"
|
||||
colorcount=256
|
||||
;;
|
||||
*)
|
||||
colorcount=$(tput colors | tr -d "\n")
|
||||
ticker_message "tput reports $colorcount colors"
|
||||
;;
|
||||
esac fi
|
||||
Reference in New Issue
Block a user