I'm sure I read about this somewhere, but could not find it at
DejaNews. In any case, in AIX 4.3, vi mishandles the alternate screen
if the terminal type is sun-cmd. Under Solaris, the cmdtool terminal
emulator has two "screen"s. One is a normal screen with scroll-back.
The second does not scroll. Under AIX 4.2.1, if you used the sun-cmd
terminal type (using terminfo entry copied from Solaris), when you
entered vi, it switched you to the alternate (non-scroll) screen. When
you left vi, you got back to the primary screen, with its previous
contents restored. All was dandy.
Under AIX 4.3.2, vi still switches you to the alternate screen on entry,
but leaves you there when you exit. This problem affects only vi. Emacs,
more, and less all seem to switch over and back okay.
Running vi under script, I think I see what is happening. When you
enter vi, it sends the curses "smcup" (start cursor-addressing mode)
sequence, as it should. When it exits, it sends the "rmcup" (exit
cursor-addressing mode) sequence, again as it should. But then it tries
to position the cursor to the bottom line of the screen, which causes
curses?? to send smcup again before using the cup sequence to perform
the cursor movement. The old vi did not perform this extra cursor
If I read the terminfo document correctly, this bug could affect all
terminals that use alternate screen pages, not just cmdtool.
As I said, I'm pretty sure I saw this discussed, but could not find the
resolution. I also couldn't find anything searching IBM's APAR web page.
Does anyone remember whether there is a solution or fix?
A vi copied from a 4.2.1 system seems to work okay so far. Can anyone
think of a reason this might be a bad idea?