mostra cores e desativa a quebra de linha

10

Usando o less paginator, você pode usar a opção -r para exibir corretamente a entrada colorida e a opção -S para desabilitar a quebra de linha.

No entanto, ao usar less -rS ou equivalentemente less -r -S , as cores são exibidas, mas as linhas são agrupadas. Como isso pode ser alcançado?

    
por Davide 03.03.2014 / 09:12

1 resposta

13

Se a opção -r não funcionar, talvez a opção -R faça o que você deseja:

-R or --RAW-CONTROL-CHARS

Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases. ANSI "color" escape sequences are sequences of the form:

ESC [ ... m

where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear.

    
por 03.03.2014 / 09:37

Tags