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

This commit is contained in:
Yuan Chiu 2025-05-04 14:40:27 +08:00
parent e78d2547c2
commit c4c518707f

View File

@ -183,11 +183,13 @@ function __pb10k_top {
[ "$info" != "" ] && __pb10k_top_left_parse "$info" [ "$info" != "" ] && __pb10k_top_left_parse "$info"
done done
if command -v tput &> /dev/null; then
terminal_width=$(tput cols) terminal_width=$(tput cols)
filler_character="─" filler_character="─"
__TOP_LEFT+="$_omb_prompt_black" __TOP_LEFT+="$_omb_prompt_black"
__TOP_LEFT+="$(for ((i=0; i<"$terminal_width"; i++)); do printf "%s" "$filler_character"; done)" __TOP_LEFT+="$(for ((i=0; i<"$terminal_width"; i++)); do printf "%s" "$filler_character"; done)"
__TOP_LEFT+="\033[${terminal_width}G\033[1K\033[1A" __TOP_LEFT+="\033[${terminal_width}G\033[1K\033[1A"
fi
IFS=" " read -ra segments <<< "$__PB10K_TOP_RIGHT" IFS=" " read -ra segments <<< "$__PB10K_TOP_RIGHT"
for seg in "${segments[@]}"; do for seg in "${segments[@]}"; do