initial terminal capability checks, allows detecting color depth and whether or not kitty extensions are available
This commit is contained in:
@@ -1,8 +1,38 @@
|
|||||||
#cols=$(stty -a | grep -Po '(?<=columns )\d+' | tr -d "\n")
|
if (( ${+commands[stty]} )); then
|
||||||
cols=$COLUMNS
|
cols=$(stty -a | grep -Po '(?<=columns )\d+' | tr -d "\n")
|
||||||
|
else
|
||||||
|
cols=$COLUMNS
|
||||||
|
fi
|
||||||
|
|
||||||
setopt prompt_subst
|
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
|
||||||
|
[[ "$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
|
||||||
|
|
||||||
function ticker_message () {
|
function ticker_message () {
|
||||||
if [[ $_zeeshdev_ticker_newlines == 0 ]]; then
|
if [[ $_zeeshdev_ticker_newlines == 0 ]]; then
|
||||||
printf "\r${(l:$cols:: :)A}\r"
|
printf "\r${(l:$cols:: :)A}\r"
|
||||||
|
|||||||
Reference in New Issue
Block a user