Strip ANSI escapes from file names

Also, use bright blue for lambdas, otherwise my eyes hurt.
This commit is contained in:
Eelco Dolstra 2016-07-21 11:21:59 +02:00
parent af5ff6c918
commit 8b60529231

View file

@ -22,7 +22,7 @@ using namespace nix;
#define ESC_RED "\033[31m" #define ESC_RED "\033[31m"
#define ESC_GRE "\033[32m" #define ESC_GRE "\033[32m"
#define ESC_YEL "\033[33m" #define ESC_YEL "\033[33m"
#define ESC_BLU "\033[34m" #define ESC_BLU "\033[34;1m"
#define ESC_MAG "\033[35m" #define ESC_MAG "\033[35m"
#define ESC_CYA "\033[36m" #define ESC_CYA "\033[36m"
#define ESC_END "\033[0m" #define ESC_END "\033[0m"
@ -655,9 +655,12 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
str << "]"; str << "]";
break; break;
case tLambda: case tLambda: {
str << ESC_BLU "«lambda defined at " << v.lambda.fun->pos << "»" ESC_END; std::ostringstream s;
s << v.lambda.fun->pos;
str << ESC_BLU "«lambda @ " << filterANSIEscapes(s.str()) << "»" ESC_END;
break; break;
}
case tPrimOp: case tPrimOp:
str << ESC_MAG "«primop»" ESC_END; str << ESC_MAG "«primop»" ESC_END;