less-unix

How to make less output persistent on the terminal, after quitting less?


On my old system (Linux Mint 18.3), every time I used the less command and quitted (q), the last viewed page of less remained on the terminal (bash) view

On my new system (Min 19.3), when I quit 'less', everything fades, as if less was never opened (similar to what happens with 'nano' command, for example)

Is there a way to make less behave like in my old system? It was very useful when working e.g. with git logs


Solution

  • From 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.