When ^[[2J is received to erase the screen, the contents of the current screen are lost. This is a problem when you do something like:
% make
[lots of errors]
% vi foo.cc
The first screen of output from "make" is lost. Apple's Terminal program saves the contents of the screen into the scrollback buffer before erasing, and I really miss that. Please see the attached 'svn diff' output.
Patch to save current screen before erasing its contents