Skip to content

Commit 44f9508

Browse files
committed
override the default pager on Windows if not found
If the pager is set to "less", the default, and we cannot find "less" on the PATH, fall back to "more", a Windows builtin. It would be cleaner for myclirc to have some kind of "pager = auto" setting but it is likely too late for that. Addresses issue #1260 .
1 parent a40df72 commit 44f9508

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Upcoming Release (TBD)
22
======================
33

4+
Bug Fixes
5+
--------
6+
* Help Windows installations find a working default pager.
7+
8+
49
Internal
510
--------
611

mycli/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,11 @@ def configure_pager(self):
10161016

10171017
cnf = self.read_my_cnf_files(self.cnf_files, ["pager", "skip-pager"])
10181018
cnf_pager = cnf["pager"] or self.config["main"]["pager"]
1019+
1020+
# help Windows users who haven't edited the default myclirc
1021+
if WIN and cnf_pager == 'less' and not shutil.which(cnf_pager):
1022+
cnf_pager = 'more'
1023+
10191024
if cnf_pager:
10201025
special.set_pager(cnf_pager)
10211026
self.explicit_pager = True

0 commit comments

Comments
 (0)