+
+/* "R" : support color
+ * "X" : do not clear the screen when leaving the pager
+ * "F" : skip the pager if content fit into the screen
+ */
+#define DEFAULT_LESS_OPTS "RXF"
+
+gboolean colored_output = TRUE;
+
+#ifdef G_OS_UNIX
+static const gchar DEFAULT_PAGER[] = "less";
+GPid child_pid = -1;
+#endif
+GMainLoop *loop = NULL;
+
+/* Console colors */
+
+/* Escape values for colors */
+#define BLUE "\033[34m"
+#define BRBLUE "\033[94m"
+#define BRCYAN "\033[96m"
+#define BRMAGENTA "\033[95m"
+#define BRYELLOW "\033[33m"
+#define CYAN "\033[36m"
+#define GREEN "\033[32m"
+#define MAGENTA "\033[35m"
+#define YELLOW "\033[33m"
+
+/* General colors */
+#define RESET_COLOR (colored_output? "\033[0m": "")
+#define HEADING_COLOR (colored_output? BRYELLOW : "")
+#define PROP_NAME_COLOR (colored_output? BRBLUE : "")
+#define PROP_VALUE_COLOR (colored_output? RESET_COLOR: "")
+#define PROP_ATTR_NAME_COLOR (colored_output? BRYELLOW : "")
+#define PROP_ATTR_VALUE_COLOR (colored_output? CYAN: "")
+/* FIXME: find a good color that works on both dark & light bg. */
+#define DESC_COLOR (colored_output? RESET_COLOR: "")
+
+/* Datatype-related colors */
+#define DATATYPE_COLOR (colored_output? GREEN : "")
+#define CHILD_LINK_COLOR (colored_output? BRMAGENTA : "")
+
+/* Caps colors */
+#define FIELD_NAME_COLOR (colored_output? CYAN: "")
+#define FIELD_VALUE_COLOR (colored_output? BRBLUE : "")
+#define CAPS_TYPE_COLOR (colored_output? YELLOW : "")
+#define STRUCT_NAME_COLOR (colored_output? YELLOW : "")
+#define CAPS_FEATURE_COLOR (colored_output? GREEN : "")
+
+/* Plugin listing colors */
+#define PLUGIN_NAME_COLOR (colored_output? BRBLUE : "")
+#define ELEMENT_NAME_COLOR (colored_output? GREEN : "")
+/* FIXME: find a good color that works on both dark & light bg. */
+#define ELEMENT_DETAIL_COLOR (colored_output? RESET_COLOR : "")
+#define PLUGIN_FEATURE_COLOR (colored_output? BRBLUE: "")
+
+/* Feature listing colors */
+#define FEATURE_NAME_COLOR (colored_output? GREEN : "")
+#define FEATURE_DIR_COLOR (colored_output? BRMAGENTA : "")
+#define FEATURE_RANK_COLOR (colored_output? CYAN : "")
+#define FEATURE_PROTO_COLOR (colored_output? BRYELLOW : "")