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

Bat as MANPAGER not working on termux #1517

Closed
atharvadnaik opened this issue Jan 12, 2021 · 4 comments
Closed

Bat as MANPAGER not working on termux #1517

atharvadnaik opened this issue Jan 12, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@atharvadnaik
Copy link

atharvadnaik commented Jan 12, 2021

What version of bat are you using?

0.17.1

Describe the bug you encountered:

After setting Bat as MANPAGER, man command gives an error.

What did you expect to happen instead?

Show coloured output of man page.

How did you install bat

pkg install bat

Environment

Termux 0.101 on Android 10 (Pie)

Architecture

aarch64

Screenshot
Screenshot_2021-01-13-00-29-52-80_84d3000e3f4017145260f7618db1d683.jpg

@atharvadnaik atharvadnaik added the bug Something isn't working label Jan 12, 2021
@sharkdp
Copy link
Owner

sharkdp commented Jan 12, 2021

While search for the "Unterminated quoted string" error message, I actually found this: termux/termux-packages#4781 😄

Same problem. Seems like termux uses a different man version that does not support complicated MANPAGER commands like this. A workaround is suggested in the linked ticket (build a wrapper script).

@atharvadnaik
Copy link
Author

atharvadnaik commented Jan 13, 2021

Thanks...I think this should be included either in README or we should write separate wiki for whole package. I am ready to help with this.

@sharkdp
Copy link
Owner

sharkdp commented Feb 15, 2021

Including it in the README sounds great.

@paxsali
Copy link

paxsali commented Feb 18, 2022

This is a workaround:

man bash | col -bx | bat -p -l man

You can keep whatever MANPAGER you have already set and then make a function and put it in your .bashrc.

man() {
    command man "$@" | eval ${MANPAGER}
}

If you are like me and use many different environments, but keep your dotfiles in one place, you may wanna put this behind a test statement which probes for a termux environment, like so:

if [[ -v TERMUX_VERSION ]]; then
    man() {
        command man "$@" | eval ${MANPAGER}
    }
fi

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants