fix(statusline): delimit ANSI escape variables

This commit is contained in:
Julian lechner committed 2026-09-17 23:01:43 +02:00
1 parent f7230dd84f
commit c2a79cf415
1 file changed
+9 -9
+9 -9
View File
@@ -47,23 +47,23 @@ used_tokens_display=$(format_token_count "$used_tokens")
context_window_display=$(format_token_count "$context_window") context_window_display=$(format_token_count "$context_window")
esc=$'\033' esc=$'\033'
reset="$esc[0m" reset="${esc}[0m"
dim="$esc[90m" dim="${esc}[90m"
cyan="$esc[96m" cyan="${esc}[96m"
magenta="$esc[95m" magenta="${esc}[95m"
blue="$esc[94m" blue="${esc}[94m"
green="$esc[92m" green="${esc}[92m"
if [ "$used_percentage" = - ]; then if [ "$used_percentage" = - ]; then
context_color=$dim context_color=$dim
elif [ "$used_percentage" -ge 85 ]; then elif [ "$used_percentage" -ge 85 ]; then
context_color="$esc[31m" context_color="${esc}[31m"
elif [ "$used_percentage" -ge 60 ]; then elif [ "$used_percentage" -ge 60 ]; then
context_color="$esc[33m" context_color="${esc}[33m"
else else
context_color=$green context_color=$green
fi fi
if [ -n "${NO_COLOR:-}" ]; then if [ -n "${NO_COLOR:-}" ]; then
reset= dim= cyan= magenta= blue= green= context_color= reset='' dim='' cyan='' magenta='' blue='' green='' context_color=''
fi fi
sep="${dim}·${reset}" sep="${dim}·${reset}"