From 00b93a6e3f643130945d60081213c27faaeba199 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 14 Jan 2025 22:34:02 -0800 Subject: Abruptly disappearing status bug. - In the basta.update_status function's path abbreviating loop, we must test whether the path can be abbreviated, and bail, before doing the abbreviation. If we do the test after the abbreviation, we create a one off error where we bail the loop with an overlong status line that does not fit even though we could have abbreviated the path by one more component. And then the status line is surprisingly blanked. --- basta.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basta.sh b/basta.sh index 045dcc9..804a2cf 100644 --- a/basta.sh +++ b/basta.sh @@ -83,10 +83,10 @@ basta.update_status() local status="$esc[7m$status_date$esc[m $HOSTNAME $dots$pwd" local status_len=$((${#status} - ${#status_esc})) [ $status_len -le $COLUMNS ] && break + [ "${pwd#/*/}" == "$pwd" ] && break pwd=${pwd#/} pwd=/${pwd#*/} dots='...' - [ "${pwd#/*/}" == "$pwd" ] && break done status_len=$((${#status} - ${#status_esc})) -- cgit v1.2.3