From 64f03635d763bd627f4fb8516c04eb64e881c902 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 12 Jul 2020 16:50:22 +0200 Subject: [PATCH] Fix ANSI color constants The `m` acts as termination-symbol when declaring graphics. Because of this, the `;1m` doesn't have any effect and is directly printed to the console: ``` $ nix repl > builtins.fetchGit { /* ... */ } { outPath = "/nix/store/s0f0iz4a41cxx2h055lmh6p2d5k5bc6r-source"; rev = "e73e45b723a9a6eecb98bd5f3df395d9ab3633b6"; revCount = ;1m428; shortRev = "e73e45b"; submodules = ;1mfalse; } ``` Introduced by 6403508f5a2fcf073b2a0d4e5fcf5f5ebb890384. --- src/libutil/ansicolor.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/ansicolor.hh b/src/libutil/ansicolor.hh index a38c2d798..ae741f867 100644 --- a/src/libutil/ansicolor.hh +++ b/src/libutil/ansicolor.hh @@ -11,7 +11,7 @@ namespace nix { #define ANSI_GREEN "\e[32;1m" #define ANSI_YELLOW "\e[33;1m" #define ANSI_BLUE "\e[34;1m" -#define ANSI_MAGENTA "\e[35m;1m" -#define ANSI_CYAN "\e[36m;1m" +#define ANSI_MAGENTA "\e[35;1m" +#define ANSI_CYAN "\e[36;1m" }