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

Enabling termcap initialization when using bat as a pager #508

Closed
rickyson96 opened this issue Feb 18, 2019 · 3 comments
Closed

Enabling termcap initialization when using bat as a pager #508

rickyson96 opened this issue Feb 18, 2019 · 3 comments
Labels
question Further information is requested

Comments

@rickyson96
Copy link

One of less option is that it can disable sending the termcap initialization and deinitialization using -X option (less -X somefile.txt). This option prints less output even after quitting. Right now, bat display output in this behavior even when displaying output with pager. Is there any way for bat to enable the termcap initialization when displaying output, so that I could have the less behavior without -X option?

PS: I know that this is a cat clone, not less clone, and this is a feature of less. But I personally think that bat is more than both, and can be used as replacement for both utility. CMIIW and feel free to close this issue if it is not applicable.

@sharkdp
Copy link
Owner

sharkdp commented Feb 18, 2019

One of less option is that it can disable sending the termcap initialization and deinitialization using -X option (less -X somefile.txt). This option prints less output even after quitting. Right now, bat display output in this behavior even when displaying output with pager.

Yes. bat actually uses less behind the scenes and it calls less with the -X option by default, unless you instruct it to do otherwise.

Is there any way for bat to enable the termcap initialization when displaying output, so that I could have the less behavior without -X option?

Yes, please see the corresponding section in the README: https://github.com/sharkdp/bat#using-a-different-pager

@sharkdp
Copy link
Owner

sharkdp commented Feb 18, 2019

Actually, there seems to be a problem with bats --pager option in the current release, as I have just found out. But you should be able to use:

export BAT_PAGER="less -FR"

@sharkdp sharkdp added the question Further information is requested label Feb 18, 2019
@rickyson96
Copy link
Author

isee @sharkdp
thank you for looking into this issue and fix it. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants