Funciona para mim; less -FS sai imediatamente se a entrada puder ser impressa em uma tela sem linhas de dobra e age normalmente se a rolagem (para a direita ou para baixo) for necessária.
Ao tentar melhorar a saída de hg diff , percebi que a opção less -F não funciona com a opção -S . Por que isso está acontecendo e como posso alcançar o efeito desejado?
Aqui está um extrato de 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.
Testado em less 444 e less 436 .
Eu estava enganado ao pensar que -S iria cortar o excesso de bytes. O conteúdo vai para a direita da tela.
Para conseguir o que eu queria, eu poderia usar apenas (...) | cut -b -80 | less -FSX .
Tags command-line bash less linux