Skip to content

Commit c132621

Browse files
committed
Fix box border misalignment — normalize literal \033 in _strlen
1 parent a78d8f7 commit c132621

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

mtproxymax.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ TERM_WIDTH=$(tput cols 2>/dev/null || echo 60)
127127
_strlen() {
128128
local clean="$1"
129129
local esc=$'\033'
130+
# Normalize literal \033 (from single-quoted color vars) to real ESC byte
131+
clean="${clean//$'\\033'/$esc}"
130132
# Strip ANSI escape sequences in pure bash (no subprocesses)
131133
while [[ "$clean" == *"${esc}["* ]]; do
132134
local before="${clean%%${esc}\[*}"

0 commit comments

Comments
 (0)