3
1
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
.
Do you really want to
-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. – Daniel Andersson – 2012-05-11T10:06:57.970@Daniel: I feel that spanning long lines through multipe lines is a little bit messy. When using less if change does not show up in first 80 columns I can always temporarily expand my term window. :) – seler – 2012-05-11T10:27:27.927
Without the color extension it gets very messy, but with it I have no issues. But we are all different human beings :-) . – Daniel Andersson – 2012-05-11T11:20:25.740
@Daniel, I've never said that I do not use color extension. This question is about less, not
hg
. – seler – 2012-05-11T13:26:12.293