From 4e41223b81b3ec3354a8d805c0ed5950cc70f285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 14 Aug 2024 10:03:12 +0800 Subject: [PATCH] Colors (Linux): only apply work around in Linux Console --- src/modules/colors/colors.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/colors/colors.c b/src/modules/colors/colors.c index aa90dd355..55192eae5 100644 --- a/src/modules/colors/colors.c +++ b/src/modules/colors/colors.c @@ -55,7 +55,11 @@ void ffPrintColors(FFColorsOptions* options) #ifdef __linux__ // Required by Linux Console for light background to work if (options->symbol == FF_COLORS_SYMBOL_BACKGROUND) - ffStrbufAppendS(&result, "\e[5m"); + { + const char* term = getenv("TERM"); + if (term && ffStrEquals(term, "linux")) + ffStrbufAppendS(&result, "\e[5m"); + } #endif // 9%d: Set the foreground to the bright color