When viewing a file with "less -S" that has lines longer than $COLUMNS
said lines are simply not wrapped. The contents of said lines is still
available, one simply needs to scroll horizontally. I would have
expected the contents displayed within less to be as if I had run
something like "cut -c 1-$COLUMNS file".

I came across this as I was wondering why "less -FS" was still
paginating on inputs with long lines that would have otherwise fit on
the screen.

I have observed this behaviour on the following platforms.

    * OpenBSD 6.5
    * OpenBSD 6.5 - current (snapshot 2019-07-19)
    * FreeBSD 12
    * Ubunutu 19.04
    * macOS 10.14.5

Given the consistent behaviour I would think it is my expectation that
is wrong rather than the observed result.

It could be argued this is a "visual truncation" from the current view.
However in my mind the word "truncation" has a very specific meaning of
dropping a remainder such that it is no longer available at all. As such
I would suggest an alteration to the description in the man page.

For reference the GNU less man page is the only one that doesn't use the
word "truncate", instead describing it as "chopped rather than folded".

diff --git a/usr.bin/less/less.1 b/usr.bin/less/less.1
index 52d2049562e..22c3324ea0f 100644
--- a/usr.bin/less/less.1
+++ b/usr.bin/less/less.1
@@ -499,10 +499,7 @@ each type of control character).
 Thus, various display problems may result,
 such as long lines being split in the wrong place.
 .It Fl S | -chop-long-lines
-Causes lines longer than the screen width to be
-chopped (truncated) rather than wrapped.
-That is, the portion of a long line that does not fit in
-the screen width is not shown.
+Lines longer than the screen width will not be wrapped.
 The default is to wrap long lines; that is, display the remainder
 on the next line.
 .It Fl s | -squeeze-blank-lines

Reply via email to