fix .bashrc: no bin file tput 則略過畫線功能

This commit is contained in:
Yuan Chiu 2025-05-04 14:58:19 +08:00
parent c4c518707f
commit 1384a71ddd

View File

@ -197,9 +197,11 @@ function __pb10k_top {
[ "$info" != "" ] && __pb10k_top_right_parse "$info" [ "$info" != "" ] && __pb10k_top_right_parse "$info"
done done
[ "$__TOP_RIGHT_LEN" -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 1 )) if command -v tput &> /dev/null; then
cursor_adjust="\033[${__TOP_RIGHT_LEN}D" [ "$__TOP_RIGHT_LEN" -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 1 ))
__TOP_LEFT+="$cursor_adjust" cursor_adjust="\033[${__TOP_RIGHT_LEN}D"
__TOP_LEFT+="$cursor_adjust"
fi
printf "%s%s" "$__TOP_LEFT" "$__TOP_RIGHT" printf "%s%s" "$__TOP_LEFT" "$__TOP_RIGHT"
} }