From 23a1b10467c669713f2c3ad1d8df558d52bde4cc Mon Sep 17 00:00:00 2001 From: yxnan Date: Thu, 27 Oct 2022 00:27:23 +0800 Subject: [PATCH] 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` --- neofetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neofetch b/neofetch index 17edbf41..5f2d67da 100755 --- a/neofetch +++ b/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.