Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 3751  / 3 Years ago, tue, may 11, 2021, 8:02:00

Previously, if I ran something | less, and then press q, it used to return me to the prompt with the output of less still visible.



$ seq 1 100 | less
1
2
3
4
:q
$ <prompt here. I can still see the output of less>


But now, after I installed Zsh (with oh-my-zsh. It doesn't work in bash too), the terminal looks like this:



$ seq 1 100 | less
<less shows up, I press :q and it is cleared>
$ <prompt here. Output of less disappears.>


I searched for a less config file and found none. Is there any way I can get less to behave the previous way? Having the output visible is very handy.


More From » bash

 Answers
0
seq 1 100 | less -X


see: man less



-X or --no-init
Disables sending the termcap initialization and deinitialization strings to the terminal.
This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.

[#26672] Thursday, May 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
earxcept

Total Points: 310
Total Questions: 115
Total Answers: 111

Location: Japan
Member since Sat, Oct 2, 2021
3 Years ago
;