Re: less -r broken with long lines

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Thu, 19 Jul 2007 19:50:43 +1000
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

Received on Thu Jul 19 2007 - 07:50:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:14 UTC