[v2] cli_pager ignored when viewing help in favor of more.com #6843
Labels
documentation
This is a problem with documentation.
feature-request
A feature should be added or improved.
p3
This is a minor priority issue
pager
issues related to AWS_PAGER, cli_pager, or other client-side paging (not API pagination)
v2
Describe the bug
I'm spending a lot of time reading the
help
output of various subcommands. Unfortunately, the default pager on Windows ismore.com
with a feature set that's... less than stellar. I've been trying unsuccessfully to get it to useless
that I've been using under Linux and Cygwin for years.Expected Behavior
Based on https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html#cli-usage-pagination-clientside I would ideally like to set
cli_pager
to the installation of less, and then if I need to pipe output to other things I can use --no-cli-pager as needed. (Someday I'll undoubtedly turn off pagination by default and then turn it on as needed, but right now I'd like it active. Obviously when scripting I pass --no-cli-pager no matter what.)It's surprisingly difficult to find examples via google of setting this key to anything other than an empty string, which I suppose reflects how many experienced AWS users are out there as opposed to relative new users.
Current Behavior
The
cli_pager
setting has been completely ignored no matter what I assign to it. I have verified that the config file is in fact being used, e.g.,will correctly produce a parse failure, so I'm editing the correct place. It's only the
cli_pager
key itself.Reproduction Steps
Passing the
--debug
option to the CLI turns on a line for "awscli.help" which is crucial here.With no PAGER or AWS_PAGER in the environment and the config entry for the default profile reading any of the following
the debug line is
MainThread - awscli.help - DEBUG - Running command: ['more']
. No errors were printed in normal output nor in the debug lines, not even anything about "unable to find paging program khrsdhksdfhskuhseuhoerw0ejwfe on line 4, what are you smoking?".Setting
PAGER=D:/full/path/to/cygwin/installation/bin/less.exe
made everything work. All four combinations above correctly used less, and as expected the debug line isMainThread - awscli.help - DEBUG - Running command: ['D:/Data/cygwin64/bin/less.exe']
.Setting
AWS_PAGER=<anything>
was ignored entirely. Same four combinations, just defaulted toMainThread - awscli.help - DEBUG - Running command: ['more']
with no errors or other debug output. No visible indication that this env variable is even being read, which is kind of disappointing in the 4th deliberate-gibberish case.Possible Solution
Using
PAGER
works to specify a pagination binary, including turning it off entirely.Additional Information/Context
No response
CLI version used
aws-cli/2.2.4 Python/3.8.8 Windows/10 exe/AMD64 prompt/off
Environment details (OS name and version, etc.)
Windows 10, tested with both CMD.EXE and Bash
The text was updated successfully, but these errors were encountered: