mshow: use "less -RFXe" when $PAGER is plain "less"

This commit is contained in:
Leah Neukirchen 2017-08-17 21:07:46 +02:00
parent 13db67713f
commit cf4bc05010

View File

@ -755,8 +755,13 @@ main(int argc, char *argv[])
if (safe_output && isatty(1)) { if (safe_output && isatty(1)) {
char *pg; char *pg;
pg = getenv("MBLAZE_PAGER"); pg = getenv("MBLAZE_PAGER");
if (!pg) if (!pg) {
pg = getenv("PAGER"); pg = getenv("PAGER");
if (pg && strcmp(pg, "less") == 0) {
static char lesscmd[] = "less -RFXe";
pg = lesscmd;
}
}
if (pg && *pg && strcmp(pg, "cat") != 0) { if (pg && *pg && strcmp(pg, "cat") != 0) {
pid2 = pipeto(pg); pid2 = pipeto(pg);
if (pid2 < 0) if (pid2 < 0)