about summary refs log tree commit diff
path: root/mshow.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-08-17 21:07:46 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-08-17 21:07:46 +0200
commitcf4bc05010a33ab012c42f46920fd79858a9b52a (patch)
tree314bba641aaae1fa4b0ef40f9be7df7f93ad42c8 /mshow.c
parent13db67713f4f2f4dde8c8dfbf7b2432560ae9230 (diff)
downloadmblaze-cf4bc05010a33ab012c42f46920fd79858a9b52a.tar.gz
mblaze-cf4bc05010a33ab012c42f46920fd79858a9b52a.tar.xz
mblaze-cf4bc05010a33ab012c42f46920fd79858a9b52a.zip
mshow: use "less -RFXe" when $PAGER is plain "less"
Diffstat (limited to 'mshow.c')
-rw-r--r--mshow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mshow.c b/mshow.c
index dc890fa..768f412 100644
--- a/mshow.c
+++ b/mshow.c
@@ -755,8 +755,13 @@ main(int argc, char *argv[])
 	if (safe_output && isatty(1)) {
 		char *pg;
 		pg = getenv("MBLAZE_PAGER");
-		if (!pg)
+		if (!pg) {
 			pg = getenv("PAGER");
+			if (pg && strcmp(pg, "less") == 0) {
+				static char lesscmd[] = "less -RFXe";
+				pg = lesscmd;
+			}
+		}
 		if (pg && *pg && strcmp(pg, "cat") != 0) {
 			pid2 = pipeto(pg);
 			if (pid2 < 0)