Clip the 'lines' parameter to scroll() at the size of the scroll
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 23 Sep 2012 15:36:54 +0000 (15:36 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 23 Sep 2012 15:36:54 +0000 (15:36 +0000)
commit8dad1c49bab966ff0e1878c4508d0eeef68a9d62
treec852daff6798c1914d237741b5e4573d193355c0
parent1172a92b4a579b7d637550b68082b8245dec26c4
Clip the 'lines' parameter to scroll() at the size of the scroll
window. scroll() iterates that many times, so this prevents a tedious
wait if you give a very large parameter to ESC[L or ESC[M, for
example.

A side effect is that very large requests for upward scrolling in a
context that affects the scrollback will not actually wipe out the
whole scrollback: instead they push just the current lines of the
screen into the scrollback, and don't continue on to fill it up with
endless boring blank lines. I think this is likely to be more useful
in general, since it avoids wiping out lots of useful scrollback data
by mistake. I can imagine that people might have been using it
precisely _to_ wipe the scrollback in some situations, but if so then
they should use CSI 3 J instead.

git-svn-id: svn://svn.tartarus.org/sgt/putty@9677 cda61777-01e9-0310-a592-d414129be87e
terminal.c