While trying to improve output from hg diff
, I noticed that less
’s -F
option does not work with its -S
option. Why is that happening and how can I achieve the desired effect?
Here is an extract from man
:
-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can be dis-
played on the first screen.
-S or --chop-long-lines
Causes lines longer than the screen width to be chopped rather
than folded. That is, the portion of a long line that does not
fit in the screen width is not shown. The default is to fold
long lines; that is, display the remainder on the next line.
Tested on less 444
and less 436
.
Explanation
I was mistaken in thinking that -S
will cut excess bytes. Content goes to the right of the screen.
To achieve what I wanted I could just use (...) | cut -b -80 | less -FSX
.
-S
? If lines are longer than your output, the remainder will just be discarded, and you will lose information in your diff. Also, since I am passing by: I hope you use thecolor
extension to get colorized diffs.hg
.