From c4c518707ff85b1ce11cd663c53d38f46127bb5c Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sun, 4 May 2025 14:40:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20.bashrc:=20no=20bin=20file=20tput=20?= =?UTF-8?q?=E5=89=87=E7=95=A5=E9=81=8E=E7=95=AB=E7=B7=9A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dot_bashrc.tmpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dot_bashrc.tmpl b/dot_bashrc.tmpl index 975c4b8..f0efc39 100644 --- a/dot_bashrc.tmpl +++ b/dot_bashrc.tmpl @@ -183,11 +183,13 @@ function __pb10k_top { [ "$info" != "" ] && __pb10k_top_left_parse "$info" done - terminal_width=$(tput cols) - filler_character="─" - __TOP_LEFT+="$_omb_prompt_black" - __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" + if command -v tput &> /dev/null; then + terminal_width=$(tput cols) + filler_character="─" + __TOP_LEFT+="$_omb_prompt_black" + __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" + fi IFS=" " read -ra segments <<< "$__PB10K_TOP_RIGHT" for seg in "${segments[@]}"; do