minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

Making cli pager optional + better visual indicators for scrolling #4819

Closed zveinn closed 9 months ago

zveinn commented 9 months ago

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 license. By creating this pull request I represent that I have the right to license the contributions to the project maintainers under the Apache 2 license.

Description

This PR is a replacement for another PR which completely removed the pager. The decision was made to keep the pager but instead trigger on the TERM environment variable.

I added an additional way to manually disable the pager using a --disable-pager flag. The name and/or usage of the flag is up for discussion in this PR

Motivation and Context

We had some clients talking about the mc client not exiting straight to terminal. Many cli tools have this scroll behavior but not everyone is a fan of it. This way we can prevent the behavior in non-supported terminals and let the user decide whether they want it or not.

Additional formatting changes

Currently the scroll indicator is located on the bottom right of the screen, which is normally the last part of the screen users look at when it comes to GUIs/Terminal usage. I've moved the percentage sign to the bottom left, where user is more likely to see it and added a scroll status indicator for the footer.

NO SCROLL: image

SCROLL: image

How to test this PR?

$ ./mc --help --disable-pager