mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Fastfetch: enable pipe mode if $NO_COLOR is set
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY result = ffStrbufCreateA(2048);
|
||||
|
||||
if (instance.config.display.brightColor)
|
||||
if (!instance.config.display.pipe && instance.config.display.brightColor)
|
||||
ffStrbufAppendS(&result, FASTFETCH_TEXT_MODIFIER_BOLT);
|
||||
|
||||
ffStrbufAppendNC(&result, options->paddingTop, '\n');
|
||||
|
||||
@@ -350,7 +350,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
|
||||
ffStrbufInitStatic(&options->keyValueSeparator, ": ");
|
||||
|
||||
options->showErrors = false;
|
||||
options->pipe = !isatty(STDOUT_FILENO);
|
||||
options->pipe = !isatty(STDOUT_FILENO) || !!getenv("NO_COLOR");
|
||||
|
||||
#ifdef NDEBUG
|
||||
options->disableLinewrap = !options->pipe;
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
#define FASTFETCH_TEXT_MODIFIER_BOLT "\033[1m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_ERROR "\033[1;31m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_RESET "\033[0m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_RESET "\033[m"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user