Skip to content

Commit 9c09596

Browse files
committed
Separator: don't print color in --pipe mode
1 parent ddc910e commit 9c09596

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/separator/separator.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "util/stringUtils.h"
55
#include "util/mallocHelper.h"
66
#include "util/wcwidth.h"
7+
#include "util/textModifier.h"
78

89
#include <locale.h>
910

@@ -46,7 +47,7 @@ void ffPrintSeparator(FFSeparatorOptions* options)
4647
+ (fqdn ? platform->hostName.length : ffStrbufFirstIndexC(&platform->hostName, '.')); // host name
4748
ffLogoPrintLine();
4849

49-
if(options->outputColor.length)
50+
if(options->outputColor.length && !instance.config.display.pipe)
5051
ffPrintColor(&options->outputColor);
5152
if(__builtin_expect(options->string.length == 1, 1))
5253
{
@@ -88,6 +89,8 @@ void ffPrintSeparator(FFSeparatorOptions* options)
8889
}
8990
}
9091
}
92+
if(options->outputColor.length && !instance.config.display.pipe)
93+
fputs(FASTFETCH_TEXT_MODIFIER_RESET, stdout);
9194
putchar('\n');
9295
setlocale(LC_CTYPE, "C");
9396
}

0 commit comments

Comments
 (0)