How do I make the most pager properly display colours in text received from standard‑input?

Note: I'm not sure whether or not it's a bug in most.

I am not encountering the same issue with less and more, only with most, which otherwise works nicely as a pager used by man.

I'm not posting an image, and invite people to try this (only if you have most installed):

$ command apropos zip | command grep --color=always zip | command less
$ command apropos zip | command grep --color=always zip | command more
$ command apropos zip | command grep --color=always zip | command most

less and more properly display colours, while most displays colours with additional “garbage” ^[[K wrapping all coloured text areas.

Surprisingly, this is OK:

$ (export PAGER=most; command man zip)

Am I missing something (the manual page for most did not help), misusing the command or is this something which I should report as a bug?

A note on less (update):

As Sparhawk mentioned in a comment, less does not work either if it's not given the option -R (or --RAW-CONTROL-CHARS) or -r (or --raw-control-chars), which may also be set in the LESS environment variable.

And indeed, I first searched for a similar option for most (but failed to find one).


All have issues with coloured UTF‑8 encoded text, not just most. In my case, the terminal is fine with it, so that's not the terminal. The same uncoloured UTF‑8 text is fine with all three pagers, so that's not the characters encoding.

  • 1
    FWIW less doesn't work for me. I need less -R. – Sparhawk Aug 15 '14 at 2:07
  • @Sparhawk, yes, sorry, I forget I have this in my profile: export LESS="--hilite-search --LINE-NUMBERS --raw-control-chars". I thought there was a similar option for most, but the manual page makes no mention of such a thing. Note: I will edit my post to tell about the LESS environment variable. – Hibou57 Aug 15 '14 at 2:13
man grep 2>/dev/null | 
GREP_COLORS=$(man grep 2>/dev/null | 
grep '^ *ms=01;31' -m1):ne \
grep '^ *GREP_COLORS *$\|^ *ne ' -A9 --color=always | 

Works for me. By the way, I just installed most to figure this out and I like it. Thank you.

          Specifies  the  colors  and other attributes
          used  to  highlight  various  parts  of  the
          output.  Its value is a colon-separated list
          of    capabilities    that    defaults    to
          with the  rv  and  ne  boolean  capabilities
          omitted     (i.e.,     false).     Supported
          capabilities are as follows.

          ne     Boolean  value that prevents clearing
                 to the end of  line  using  Erase  in
                 Line  (EL) to Right (\33[K) each time
                 a  colorized  item  ends.   This   is
                 needed  on  terminals  on which EL is
                 not  supported.   It   is   otherwise
                 useful  on  terminals  for  which the
                 back_color_erase    (bce)     boolean
                 terminfo  capability  does not apply,
                 when the chosen highlight  colors  do
| improve this answer | |
  • @Hibou57 - is there anything about this answer that des not answer your question? – mikeserv Aug 17 '14 at 1:10
  • 1
    I am encountering this as well. I don't understand the command in this answer, and when I try it on my system I get an instance of most displaying nothing. The answer also seems very specific to grep, and I'm experiencing the color-display-plus-escape-codes issue with more than just grep. - MacOS 10.12.6 with bash 4.4.19(1)-release (x86_64-apple-darwin16.7.0) – adfaklsdjf Apr 15 '18 at 1:36
  • Unfortunately the answer is not great because it does not quite explain the situation. I can autogenerate all escape codes, colours work fine in KDE konsole, but the pagers don't seem to handle these escape codes at all. :( – shevy May 23 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.