Wp-cli: Can't run help commands in docker/alpine because imcompatible less options

Created on 23 Feb 2017  路  4Comments  路  Source: wp-cli/wp-cli

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?

framework unconfirmed

Most helpful comment

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)

All 4 comments

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ernilambar picture ernilambar  路  3Comments

yratof picture yratof  路  3Comments

mirzazeyrek picture mirzazeyrek  路  3Comments

killown picture killown  路  3Comments

tillkruss picture tillkruss  路  3Comments