From 1384a71ddd9f10202060f191c2ea77bf5b6b5dc3 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Sun, 4 May 2025 14:58:19 +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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dot_bashrc.tmpl b/dot_bashrc.tmpl index f0efc39..6904748 100644 --- a/dot_bashrc.tmpl +++ b/dot_bashrc.tmpl @@ -197,9 +197,11 @@ function __pb10k_top { [ "$info" != "" ] && __pb10k_top_right_parse "$info" done - [ "$__TOP_RIGHT_LEN" -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 1 )) - cursor_adjust="\033[${__TOP_RIGHT_LEN}D" - __TOP_LEFT+="$cursor_adjust" + if command -v tput &> /dev/null; then + [ "$__TOP_RIGHT_LEN" -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 1 )) + cursor_adjust="\033[${__TOP_RIGHT_LEN}D" + __TOP_LEFT+="$cursor_adjust" + fi printf "%s%s" "$__TOP_LEFT" "$__TOP_RIGHT" }