aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-07-20 16:57:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-07-20 16:57:29 +0000
commiteb396f5b0bb17fecfc3db0045d2979fa42d4478d (patch)
tree3b8fb3cbf1050568658bfa9406b2b9eb514f1c0d /main.c
parentd9eddf28f1aa31476f2335c1e6fc7002b64ea830 (diff)
downloadmandoc-eb396f5b0bb17fecfc3db0045d2979fa42d4478d.tar.gz
mandoc-eb396f5b0bb17fecfc3db0045d2979fa42d4478d.tar.zst
mandoc-eb396f5b0bb17fecfc3db0045d2979fa42d4478d.zip
Switch the default pager from "more -s" to "less".
POSIX explicitly allows using a different default pager if that is documented. Nowadays, the pager provided in most operating systems is less(1). Our man(1) implementation uses less(1) features that traditional more(1) did not provide, in particular tagging. Besides, as noted by deraadt@, the user interface of less(1) is slightly more refined and preferable over the user inferface of more(1). This switch was originally suggested by Ian Ropers. In ./configure, test whether less(1) is available. If not, fall back to more(1). In ./configure.local, support overriding the automatic test by setting BINM_PAGER. As explained by jmc@ and deraadt@, the -s flag was added a very long time ago when an antique version of groff(1) had an annoying bug in terminal output that would randomly display blank lines in the middle of pages. Clearly, -s has no longer been needed for many years, so drop it from the default pager invocation. OK deraadt@ jmc@ martijn@ job@ on the OpenBSD version of this patch.
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index cafbeb9f..c32caee7 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.350 2020/06/15 17:25:42 schwarze Exp $ */
+/* $Id: main.c,v 1.351 2020/07/20 16:57:30 schwarze Exp $ */
/*
* Copyright (c) 2010-2012, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1218,7 +1218,7 @@ spawn_pager(struct outstate *outst, char *tag_target)
if (pager == NULL || *pager == '\0')
pager = getenv("PAGER");
if (pager == NULL || *pager == '\0')
- pager = "more -s";
+ pager = BINM_PAGER;
cp = mandoc_strdup(pager);
/*