diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-07-21T09·21+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-07-21T09·21+0200 |
commit | 8b6052923167f19c1f4728c46e8cfc97b9f029fb (patch) | |
tree | e246326334bf9f290c3e5719b61ed65293e4017f | |
parent | af5ff6c9184b12004a6bc190b20c02abdbc5e69e (diff) |
Strip ANSI escapes from file names
Also, use bright blue for lambdas, otherwise my eyes hurt.
-rw-r--r-- | nix-repl.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nix-repl.cc b/nix-repl.cc index ab943f7bac1b..0e8c67cf7f28 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; |