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:
parent
0dae7ca3f9
commit
23a1b10467
1 changed files with 3 additions and 0 deletions
3
neofetch
3
neofetch
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue