summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scoop.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/scoop.c b/scoop.c
index 0b652d9..f32da90 100644
--- a/scoop.c
+++ b/scoop.c
@@ -187,9 +187,14 @@ int main(int argc, char *argv[]) {
 	if (search) dbBindText(stmt, ":search", search);
 	dbBindInt(stmt, ":limit", limit);
 
-	// FIXME: Conditional on terminal.
-	dbBindText(stmt, ":open", "\33[33m");
-	dbBindText(stmt, ":close", "\33[m");
+	if (tty) {
+		dbBindText(stmt, ":open", "\33[33m");
+		dbBindText(stmt, ":close", "\33[m");
+	} else {
+		// XXX: If you leave these NULL fts5 segfaults...
+		dbBindText(stmt, ":open", "");
+		dbBindText(stmt, ":close", "");
+	}
 
 	if (verbose) {
 		char *expand = sqlite3_expanded_sql(stmt);
t'> 2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe 2021-01-19Don't use a pager if reading standard inputJune McEnroe 2021-01-19Support BSD make syntax and match *.amJune McEnroe These don't really go together, but... 2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe Otherwise it ends up going into Shell state. 2021-01-18Allow matching lexers using first input lineJune McEnroe