about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 5f2d95339f30..f6f5d1b3fee7 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -369,4 +369,16 @@ string decodeOctalEscaped(const string & s);
 void ignoreException();
 
 
+/* Some ANSI escape sequences. */
+#define ANSI_NORMAL "\e[0m"
+#define ANSI_BOLD "\e[1m"
+#define ANSI_RED "\e[31;1m"
+
+
+/* Filter out ANSI escape codes from the given string. If ‘nixOnly’ is
+   set, only filter escape codes generated by Nixpkgs' stdenv (used to
+   denote nesting etc.). */
+string filterANSIEscapes(const string & s, bool nixOnly = false);
+
+
 }