2026-02-25 14:34:54 -08:00
|
|
|
if (( ${+commands[stty]} )); then
|
|
|
|
|
cols=$(stty -a | grep -Po '(?<=columns )\d+' | tr -d "\n")
|
|
|
|
|
else
|
|
|
|
|
cols=$COLUMNS
|
|
|
|
|
fi
|
2020-04-20 02:05:56 -07:00
|
|
|
|
2023-06-30 16:18:38 -07:00
|
|
|
setopt prompt_subst
|
|
|
|
|
|
2026-02-25 14:34:54 -08:00
|
|
|
kitty_available=n
|
|
|
|
|
if (( ${+KITTY_SHELL_INTEGRATION} )); then
|
|
|
|
|
kitty_available=y
|
|
|
|
|
[[ "$KITTY_SHELL_INTEGRATION" == "disabled" ]] && return # don't integrate if configured not to
|
|
|
|
|
autoload -Uz -- "${KITTY_INSTALLATION_DIR}/shell-integration/zsh/kitty-integration"
|
|
|
|
|
kitty-integration && unfunction kitty-integration
|
|
|
|
|
fi
|
|
|
|
|
|
2021-08-24 19:10:32 -07:00
|
|
|
function ticker_message () {
|
|
|
|
|
if [[ $_zeeshdev_ticker_newlines == 0 ]]; then
|
|
|
|
|
printf "\r${(l:$cols:: :)A}\r"
|
|
|
|
|
printf "$@"
|
|
|
|
|
else
|
|
|
|
|
printf "$@\n"
|
|
|
|
|
fi
|
2020-04-20 02:05:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ticker_finish () {
|
2021-08-24 19:10:32 -07:00
|
|
|
[[ $_zeeshdev_ticker_newlines == 0 ]] && printf "\r${(l:$cols:: :)A}\r"
|
2020-04-20 02:05:56 -07:00
|
|
|
}
|
2026-02-25 15:25:29 -08:00
|
|
|
|
|
|
|
|
# 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
|