Aha! At long last I've managed to reproduce the intermittent problem
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 15 Aug 2006 12:45:21 +0000 (12:45 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 15 Aug 2006 12:45:21 +0000 (12:45 +0000)
commit35a46e796117ee8813f6ad1a045fb0ac608b4347
tree52d6047a3439ee12432f2cf7487dc50c35196962
parent0ac1920cf35f15c8fd8dbfedb332bd79e5ecdd33
Aha! At long last I've managed to reproduce the intermittent problem
I've been having with the cursor sometimes restoring to the wrong
place when screen(1) terminates. The offending sequence of escape
sequences goes ESC 7 (save cursor), ESC [?47h (switch to alternate
screen), ESC 7 (save cursor _again_), do some stuff, ESC 8 (restore
cursor), run screen session for a bit, ESC [?47l (return to main
screen), ESC 8 (restore cursor). The final ESC 8 is expected to
restore the cursor to where it was saved by the initial ESC 7.

Translation: the ESC 7 saved cursor state is part of the state we
must swap out when switching to the alternate screen. In other
words, we need to track _four_ cursor positions: active and saved,
on each of main and alternate screen. Previously we were tracking
only three.

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