summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCheer Xiao <xiaqqaix@gmail.com>2012-12-10 17:38:55 +0800
committerCheer Xiao <xiaqqaix@gmail.com>2012-12-10 17:41:31 +0800
commit6bd182d83a0edad921916f210a62ca2cebf1cc31 (patch)
treee1b2f27e64f6a11318bec7650e2ea9bccb5de67a
parent76d8ea5c1eb3caf7a4f73fcd8a91da0dd4fed81d (diff)
downloadranger-6bd182d83a0edad921916f210a62ca2cebf1cc31.tar.gz
scope.sh: wrap highlight to treat exit code 141 as success
-rwxr-xr-xranger/data/scope.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 3a6504dd..c997726a 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -33,6 +33,8 @@ extension=${path##*.}
 function have { type -P "$1" > /dev/null; }
 # "success" returns the exit code of the first program in the last pipe chain
 function success { test ${PIPESTATUS[0]} = 0; }
+# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
+function highlight { command highlight "$@"; test $? = 0 -o $? = 141; }
 
 case "$extension" in
 	# Archive extensions: