Make text colour work in MacOS zsh (#450)

This commit is contained in:
Mitchell Pomery 2022-11-27 05:39:18 +11:00 committed by GitHub
commit 85e75dbab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,13 +256,13 @@ function common::per_dir_hook {
#######################################################################
function common::colorify {
# shellcheck disable=SC2034
local -r red="\e[0m\e[31m"
local -r red="\x1b[0m\x1b[31m"
# shellcheck disable=SC2034
local -r green="\e[0m\e[32m"
local -r green="\x1b[0m\x1b[32m"
# shellcheck disable=SC2034
local -r yellow="\e[0m\e[33m"
local -r yellow="\x1b[0m\x1b[33m"
# Color reset
local -r RESET="\e[0m"
local -r RESET="\x1b[0m"
# Params start #
local COLOR="${!1}"