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:
yxnan
2022-10-27 00:27:23 +08:00
committed by GitHub
parent 0dae7ca3f9
commit 23a1b10467

View File

@@ -13702,6 +13702,9 @@ main() {
get_distro
get_bold
get_distro_ascii
# check if the output is a interactive terminal
[[ -t 1 ]] || stdout=on
[[ $stdout == on ]] && stdout
# Minix doesn't support these sequences.