I have a question just opposite to Is there any way to exit "less" without clearing the screen?: my less exits without clearing the screen, but I have never used -X.
The options I use is as follows:
$ echo $LESS
-N -g -i -M -R -w -z-4
$ echo $LESSOPEN
$
$ echo $TERM
ansi
I remember when my less started to change its behavior: when I was trying to type something to another application but my cursor was in the terminal with less opening. When I realized I'm typing into a wrong place and tried to quit less, the file contents start to remaining to my terminal. I'm using MacOS terminal (not iTerm2).
As @roaima suggested, my issue is to get the less's standard behavior without -X. However, -+X does not work; and -X is not in LESS.
I'm using OSX Terminal.app, not iTerm2.