@andrewkent/claude-statusline 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/statusline.sh +15 -4
- package/package.json +1 -1
package/assets/statusline.sh
CHANGED
|
@@ -784,7 +784,7 @@ if [ -n "$usage_data" ] && echo "$usage_data" | jq -e . >/dev/null 2>&1; then
|
|
|
784
784
|
|
|
785
785
|
# ── Burn-down projection ──────────────────────────
|
|
786
786
|
# Estimate minutes until 100% based on utilization velocity
|
|
787
|
-
if [ "$five_hour_pct" -gt
|
|
787
|
+
if [ "$five_hour_pct" -gt 0 ] 2>/dev/null && [ -n "$five_hour_reset_iso" ] && [ "$five_hour_reset_iso" != "" ]; then
|
|
788
788
|
reset_epoch=$(iso_to_epoch "$five_hour_reset_iso")
|
|
789
789
|
if [ -n "$reset_epoch" ]; then
|
|
790
790
|
now_bd=$(date +%s)
|
|
@@ -805,19 +805,30 @@ if [ -n "$usage_data" ] && echo "$usage_data" | jq -e . >/dev/null 2>&1; then
|
|
|
805
805
|
if (rate > 0) printf \"%.0f\", $remaining_pct / rate / 60;
|
|
806
806
|
else print 999
|
|
807
807
|
}")
|
|
808
|
-
if [ "$mins_to_full" -
|
|
808
|
+
if [ "$mins_to_full" -gt 0 ] 2>/dev/null && [ "$mins_to_full" -lt 6000 ] 2>/dev/null; then
|
|
809
809
|
bd_color="$green"
|
|
810
810
|
[ "$mins_to_full" -le 60 ] && bd_color="$orange"
|
|
811
811
|
[ "$mins_to_full" -le 30 ] && bd_color="$yellow"
|
|
812
812
|
[ "$mins_to_full" -le 15 ] && bd_color="$red"
|
|
813
|
-
|
|
813
|
+
|
|
814
|
+
if [ "$mins_to_full" -ge 60 ] 2>/dev/null; then
|
|
815
|
+
full_display=$(awk "BEGIN { printf \"%.1fh\", $mins_to_full / 60 }")
|
|
816
|
+
else
|
|
817
|
+
full_display="${mins_to_full}m"
|
|
818
|
+
fi
|
|
819
|
+
rate_lines+=" ${bd_color}→full ~${full_display}${reset}"
|
|
814
820
|
|
|
815
821
|
# Survive indicator: buffer or downtime until window resets
|
|
816
822
|
mins_to_reset=$(( secs_to_reset / 60 ))
|
|
817
823
|
if [ "$mins_to_reset" -gt 0 ] 2>/dev/null; then
|
|
818
824
|
if [ "$mins_to_full" -gt "$mins_to_reset" ] 2>/dev/null; then
|
|
819
825
|
buffer=$(( mins_to_full - mins_to_reset ))
|
|
820
|
-
|
|
826
|
+
if [ "$buffer" -ge 60 ] 2>/dev/null; then
|
|
827
|
+
buf_display=$(awk "BEGIN { printf \"%.1fh\", $buffer / 60 }")
|
|
828
|
+
else
|
|
829
|
+
buf_display="${buffer}m"
|
|
830
|
+
fi
|
|
831
|
+
rate_lines+=" ${green}✓${buf_display}${reset}"
|
|
821
832
|
else
|
|
822
833
|
downtime=$(( mins_to_reset - mins_to_full ))
|
|
823
834
|
if [ "$downtime" -ge 60 ] 2>/dev/null; then
|