agnoster-theme-baz-plugin/plugin/functions/ansi
Ari Archer ef9160c4a6
init
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-06-18 23:04:43 +03:00

14 lines
303 B
Bash

local seq
declare -a mycodes=("${!1}")
debug "ansi: ${!1} all: $* aka ${mycodes[@]}"
seq=""
for ((i = 0; i < ${#mycodes[@]}; i++)); do
if [[ -n $seq ]]; then
seq="${seq};"
fi
seq="${seq}${mycodes[$i]}"
done
debug "ansi debug:" '\\[\\033['${seq}'m\\]'
echo -ne '\[\033['${seq}'m\]'