Skip to content

Commit c0f2971

Browse files
fix: ANSI escape sequence not rendering (#1643)
1 parent 4071db1 commit c0f2971

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plugins/terminal/scripts/init-alpine.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,20 @@ fi
9393
command_not_found_handle() {
9494
cmd="$1"
9595
pkg=""
96-
green="\033[1;32m"
97-
reset="\033[0m"
96+
green="\e[1;32m"
97+
reset="\e[0m"
9898
9999
pkg=$(apk search -x "cmd:$cmd" 2>/dev/null | awk -F'-[0-9]' '{print $1}' | head -n 1)
100100
101101
if [ -n "$pkg" ]; then
102-
printf "The program '%s' is not installed.\nInstall it by executing:\n %sapk add %s%s\n" "$cmd" "$green" "$pkg" "$reset" >&2
102+
echo -e "The program '$cmd' is not installed.\nInstall it by executing:\n ${green}apk add $pkg${reset}" >&2
103103
else
104-
printf "The program '%s' is not installed and no package provides it.\n" "$cmd" >&2
104+
echo "The program '$cmd' is not installed and no package provides it." >&2
105105
fi
106106
107107
return 127
108108
}
109+
109110
EOF
110111
fi
111112

0 commit comments

Comments
 (0)