Skip to content

Commit 78d10e3

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 9379f4e commit 78d10e3

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Internal
55
--------
66

77
* Add limited typechecking to CI.
8+
* Help Windows installations find a working default pager.
89

910

1011
1.35.0 (2025/07/18)

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)