Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug?: disabling paging is impossible without overriding the pager #2629

Closed
vn971 opened this issue Jul 24, 2023 · 3 comments · Fixed by #2641
Closed

Bug?: disabling paging is impossible without overriding the pager #2629

vn971 opened this issue Jul 24, 2023 · 3 comments · Fixed by #2641
Labels
feature-request New feature or request

Comments

@vn971
Copy link

vn971 commented Jul 24, 2023

Currently, it is possible to disable paging in CLI via bat --paging=never. To make this configuration global, the help page / man pages suggest overriding the pager environment variable, BAT_PAGER. However, this behavior seems to be error-prone:

If BAT_PAGER is overridden, it is hard to "fix" it in CLI. Normally, env variables are overridden by CLI keys. E.g. with the standard CLI conventions, if you have BAT_PAGING=never and you'd run bat --paging-never, you'd get paging. With the current version of bat (0.23.0 (871abd27)), this is impossible.

This might be low-prio because I'm actually intending to set bat to non-paging mode by default and may not even switch back. I'm leaving this to the author's discretion. I'm also not sure if the issue is a "bug" (inconsistency with the standard CLI conventions), or simply a feature request. Triaging is welcomed

Thanks for the nice tool! ❤️

@YeungOnion
Copy link
Contributor

Just to get a sense of this, would an alias with --no-paging not be suitable for your use case? I'd expect the need for paging/no-paging to be related to using an interactive shell as cat seems a better used tool if there's not a user involved.

@vn971
Copy link
Author

vn971 commented Aug 8, 2023

@YeungOnion do you mean an alias with --paging=never? That does definitely help and that is what I'm currently doing locally. bat can do much more than cat even without paging: syntax highlight, line numbers and overall formatting just to name a few

@YeungOnion
Copy link
Contributor

Ah, you're right and that's what I meant. I'm thinking now that I just have too strong a preference that environment variables are a user's responsibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants