LESS environment variable having -?[rR] (note: doesn't have to be separate
word, there might be false positive test results), or
less itself having -[rR] switch (note2: only before first non-option
argument, so some false positives possible too)
Skip highlight(ing) when it wouldn't interpret them.
Changed files:
lesspipe.sh -> 1.39
xterm|xterm-color) output=xterm256;;
*) output=ansi;;
esac
- run-mailcap "$1" || highlight --$output --style=darkblue "$1"
+ run-mailcap "$1" || \
+ { echo $LESS | grep -qi r || ps -p `ps -p $PPID -oppid=` -oargs= | grep -qiw -- -r && highlight --$output --style=darkblue "$1"; }
# Check to see if binary, if so -- view with 'strings'
# FILE=$(file -L "$1")
esac