summary refs log tree commit diff
path: root/scoop.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-31 15:30:41 -0500
committerJune McEnroe <june@causal.agency>2019-12-31 15:30:41 -0500
commit5515a70dabf9af1b63727734b5ccafbce009cec5 (patch)
treec2515edc20e7589b54c904d47144c80649d9c6b8 /scoop.c
parentSet up pager pipe (diff)
downloadlitterbox-5515a70dabf9af1b63727734b5ccafbce009cec5.tar.gz
litterbox-5515a70dabf9af1b63727734b5ccafbce009cec5.zip
Only enable highlighting on terminal output
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);
er-for-flag-check?h=3.8.1&id=20e2ef936b182c461b604fa874a556abd07c98e2&follow=1'>import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe