From 8b6052923167f19c1f4728c46e8cfc97b9f029fb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 21 Jul 2016 11:21:59 +0200 Subject: [PATCH] Strip ANSI escapes from file names Also, use bright blue for lambdas, otherwise my eyes hurt. --- nix-repl.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nix-repl.cc b/nix-repl.cc index ab943f7ba..0e8c67cf7 100644 --- a/nix-repl.cc +++ b/nix-repl.cc @@ -22,7 +22,7 @@ using namespace nix; #define ESC_RED "\033[31m" #define ESC_GRE "\033[32m" #define ESC_YEL "\033[33m" -#define ESC_BLU "\033[34m" +#define ESC_BLU "\033[34;1m" #define ESC_MAG "\033[35m" #define ESC_CYA "\033[36m" #define ESC_END "\033[0m" @@ -655,9 +655,12 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m str << "]"; break; - case tLambda: - str << ESC_BLU "«lambda defined at " << v.lambda.fun->pos << "»" ESC_END; + case tLambda: { + std::ostringstream s; + s << v.lambda.fun->pos; + str << ESC_BLU "«lambda @ " << filterANSIEscapes(s.str()) << "»" ESC_END; break; + } case tPrimOp: str << ESC_MAG "«primop»" ESC_END;