less -Sr colourful.log How to view colourful log in less?

1

Both less -r (preserve terminal control sequences) and less -S (chop long lines) work well alone. But using them together breaks things. It chops too late and it wrecks the next line.

Reducing COLUMNS environment variable is no op: (man less)

But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.

How to view colourful logs with less?

Resoved before asked: less -SR

Vi.

Posted 2010-05-24T18:04:08.910

Reputation: 13 705

Answers

1

less -SR will make less interpret colour sequences explicitly and will fix "-S".

Vi.

Posted 2010-05-24T18:04:08.910

Reputation: 13 705