#832707 less: resets ANSI colors at each newline

Package:
less
Source:
less
Description:
pager program similar to more
Submitter:
Josh Triplett
Date:
2024-05-01 02:09:04 UTC
Severity:
normal
Tags:
#832707#3
Date:
2016-07-28 09:09:02 UTC
From:
To:
less -R passes through ANSI color sequences; however, it seems to reset
ANSI colors at each newline.  For an example, try running the following:

/usr/bin/printf '\e[1mHello\nworld\n\e[0m'

This should print two lines to the terminal, both of them bold.  Then
try running the same through less -R:

/usr/bin/printf '\e[1mHello\nworld\n\e[0m' | less -R

This shows the first line bold, and the second line normal.

- Josh Triplett