Only output colour escapes when attached to a tty
This commit is contained in:
1 parent
840a493e62
commit
19fce2aa8c
1 file changed
+2
-2
+2
-2
@@ -36,12 +36,12 @@ remote() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
colourise() {
|
colourise() {
|
||||||
echo -ne '\e['$1'm'
|
[ -t 0 ] && echo -ne '\e['$1'm' || true
|
||||||
shift
|
shift
|
||||||
# It's important that we don't do this in a subshell, as some
|
# It's important that we don't do this in a subshell, as some
|
||||||
# commands we execute need to modify global state
|
# commands we execute need to modify global state
|
||||||
"$@"
|
"$@"
|
||||||
echo -ne '\e[0m'
|
[ -t 0 ] && echo -ne '\e[0m' || true
|
||||||
}
|
}
|
||||||
|
|
||||||
whitely() {
|
whitely() {
|
||||||
|
|||||||
Reference in new issue
Block a user