Check if the output is a tty
The color code should not be emitted if the stdout is not a typical terminal, we add the check so there is no need to explictly specify `--stdout`
This commit is contained in:
@@ -13702,6 +13702,9 @@ main() {
|
|||||||
get_distro
|
get_distro
|
||||||
get_bold
|
get_bold
|
||||||
get_distro_ascii
|
get_distro_ascii
|
||||||
|
|
||||||
|
# check if the output is a interactive terminal
|
||||||
|
[[ -t 1 ]] || stdout=on
|
||||||
[[ $stdout == on ]] && stdout
|
[[ $stdout == on ]] && stdout
|
||||||
|
|
||||||
# Minix doesn't support these sequences.
|
# Minix doesn't support these sequences.
|
||||||
|
|||||||
Reference in New Issue
Block a user