about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-21T09·21+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-21T09·21+0200
commit8b6052923167f19c1f4728c46e8cfc97b9f029fb (patch)
treee246326334bf9f290c3e5719b61ed65293e4017f
parentaf5ff6c9184b12004a6bc190b20c02abdbc5e69e (diff)
Strip ANSI escapes from file names
Also, use bright blue for lambdas, otherwise my eyes hurt.
-rw-r--r--nix-repl.cc9
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;