diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-14 22:34:02 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-14 22:34:02 -0800 |
commit | 00b93a6e3f643130945d60081213c27faaeba199 (patch) | |
tree | 613310de5e46daca23ea33637e725ebd092a3bbd | |
parent | f2a4af98772170d7a4f13faf5fa00398231d510d (diff) | |
download | basta-00b93a6e3f643130945d60081213c27faaeba199.tar.gz basta-00b93a6e3f643130945d60081213c27faaeba199.tar.bz2 basta-00b93a6e3f643130945d60081213c27faaeba199.zip |
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.
-rw-r--r-- | basta.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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})) |