I'm getting this output trying to see wp-cli help.
/var/www/html # wp --allow-root help
less: unrecognized option: r
BusyBox v1.24.2 (2016-11-01 12:56:05 GMT) multi-call binary.
Usage: less [-EIMmNSh~] [FILE]...
View FILE (or stdin) one screenful at a time
-E Quit once the end of a file is reached
-I Ignore case in all searches
-M,-m Display status line with line numbers
and percentage through the file
-N Prefix line number to each line
-S Truncate long lines
-~ Suppress ~s displayed past EOF
I'm running in a custom images based on php:7-fpm-alpine.
Googling, I found the same issue in this (another) project: https://github.com/pry/pry/issues/1494#issuecomment-162336567
They has a workaround, but is possible to make wp-cli more compatible?
Have you tried setting the PAGER environment variable?
Yes, i'm using the following to run a shell of my docker:
docker exec -it www_php_1 /bin/sh -c "export TERM=xterm; export PAGER='busybox less'; exec sh"
Works, but... is just a workaround.
Ok. That's what the PAGER environment variable is there for.
For those of you suffering from garbled output when using busybox less as a value for the PAGER env variable, use more instead. Works beautifully!
(Thanks to @jeffyjefflabs for the tip used in nbgallery/jupyter-docker@e471c470f4bc906c6763cf9a9232386c6c741f9f)
Most helpful comment
For those of you suffering from garbled output when using
busybox lessas a value for thePAGERenv variable, usemoreinstead. Works beautifully!(Thanks to @jeffyjefflabs for the tip used in nbgallery/jupyter-docker@e471c470f4bc906c6763cf9a9232386c6c741f9f)