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

Passing Strings in MANPAGER Doesn't Work #4781

Closed
JacobTDC opened this issue Jan 10, 2020 · 3 comments
Closed

Passing Strings in MANPAGER Doesn't Work #4781

JacobTDC opened this issue Jan 10, 2020 · 3 comments

Comments

@JacobTDC
Copy link
Contributor

Passing strings in the MANPAGER variable doesn't work, for example:

$ export MANPAGER="sh -c 'col -bx | bat -l man -p'"
$ man 2 select
-bx: 1: -bx: Syntax error: Unterminated quoted string

This happens regardless of the shell I'm using, and even if I change the sh to bash, dash, or fish. For some reason, man doesn't understand strings and spaces in the MANPAGER variable.

@ghost
Copy link

ghost commented Jan 10, 2020

We use a different implementation of man - http://mdocml.bsd.lv instead of https://www.nongnu.org/man-db/ because it is lightweight.

Issue is not Termux-specific and happens in Alpine Linux too and possibly other distributions where mdocml is used.

@JacobTDC
Copy link
Contributor Author

JacobTDC commented Jan 10, 2020

@xeffyr, then how would I make the above code work? I mean, I could just make an executable script file for it, but that's not a very elegant solution...

@ghost
Copy link

ghost commented Jan 10, 2020

then how would I make the above code work?

mdocml does very basic parsing of MANPAGER. It splits arguments by space so calling sh here will not work.

You need to use wrapper here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant