less -r broken with long lines
Peter Jeremy
peterjeremy at optushome.com.au
Thu Jul 19 09:50:54 UTC 2007
On 2007-Jul-18 21:09:31 +0100, Rui Paulo <rpaulo at fnop.net> wrote:
>It depends on the interpretation. "various display problems may result"
>may very well be a reference to the fact that control characters mangle
>the output. I wasn't expecting long lines to mangle the output. If you
>less -r a file without control characters, but with a least a line wider
>than your screen size, you'll notice the problem.
I think the behaviour of "less" is reasonable. To correctly work out
how many lines of input will fill the screen, "less" needs to identify
if/where the terminal will split a string of characters into distinct
physical lines. In the face of arbitrary control sequences, it is
impossible for "less" to determine this since it cannot know how a
particular string will be processed. (It can't rely on termcap/info
strings because they are unlikely to document all terminal features).
--
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20070719/f091a50a/attachment.pgp
More information about the freebsd-current
mailing list