title: git diff: what pager?
body: <p>When I run <code>git diff</code> on some file, what pager is it using?  I ask because for every other command line tool I use with a pager in Linux, when I quit (by typing 'q'), the terminal reverts to what it was displaying before, with the only evidence that I ran s.t. being the command line itself.  For example:</p>
  
  <pre><code>&gt; git help diff
  &gt; 
  </code></pre>
  
  <p>Same with <code>man</code>, <code>less</code> itself, etc.  But when I run <code>git diff</code>, the entire diff remains on the screen, even if it was hundreds of lines long.  So if I want to look at the output of previous commands, I have to scroll way back.  </p>
  
  <p>This seems to be the behavior of <code>less -X</code>, which "Disables sending the termcap initialization and deinitialization strings to the  terminal".</p>
  
  <p>I've read the documentation for <code>git diff</code>, but nowhere do I see it say how to restore the terminal to the way it was before I ran the diff.  I can <code>export PAGER=/bin/less</code>, but this has no effect (it's maybe the default pager for <code>git diff</code>).</p>
  
  <p>It may be that <code>git diff</code> is somehow passing a <code>-X</code> parameter to <code>less</code>.  But if so, I don't see anyway to turn that behavior off (the man page for <code>less</code> is silent about this).</p>
  
  <p>Related: <a href="https://unix.stackexchange.com/questions/167735/can-less-f-be-usefully-combined-with-termcap-initialization">https://unix.stackexchange.com/questions/167735/can-less-f-be-usefully-combined-with-termcap-initialization</a>.  But that doesn't tell my why <code>git diff</code> behaves as if it is passing the <code>-X</code> parameter.  (FWIW, my terminal reports that it's xterm-256color.)</p>