about summary refs log tree commit diff
path: root/mless
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 12:07:33 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 12:54:03 +0200
commit7a27586bcbf6ef4330b8bc5b969bafa339293e77 (patch)
tree76f9ed627a95059e0056e4ebb025d3400ac1ddd8 /mless
parent525233811c0f7c9358c5b12c6f7ceecf5bfe7d96 (diff)
downloadmblaze-7a27586bcbf6ef4330b8bc5b969bafa339293e77.tar.gz
mblaze-7a27586bcbf6ef4330b8bc5b969bafa339293e77.tar.xz
mblaze-7a27586bcbf6ef4330b8bc5b969bafa339293e77.zip
mless: R to toggle raw message
Diffstat (limited to 'mless')
-rwxr-xr-xmless12
1 files changed, 11 insertions, 1 deletions
diff --git a/mless b/mless
index 72ddd6c..97bce56 100755
--- a/mless
+++ b/mless
@@ -46,7 +46,13 @@ if [ "$1" = --filter ]; then
 		exit
 	fi
 
-	mshow "$2" | colormsg
+	if [ $MLESS_RAW -eq 0 ]; then
+		mshow "$2" | colormsg
+	else
+		mseq -r $2
+		echo
+		cat "$(mseq -r $2)"
+	fi
 	exit $?
 fi
 
@@ -71,6 +77,7 @@ fi
 
 nl="
 "
+export MLESS_RAW=0
 while :; do
 	[ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless
 	LESSOPEN="|$0 --filter %s" \
@@ -87,5 +94,8 @@ while :; do
 		mflag -S .
 		mseq -f : | mseq -S
 		mseq -C +
+		;;
+	82) # R toggle raw mode
+		MLESS_RAW=$((1-$MLESS_RAW))
 	esac
 done