vi/curses bug, AIX 4.3.2, alternate screens

vi/curses bug, AIX 4.3.2, alternate screens

Post by Dale Talco » Sat, 10 Apr 1999 04:00:00



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
movement.

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?

--

                                        http://quest.cc.purdue.edu/~aeh/

 
 
 

vi/curses bug, AIX 4.3.2, alternate screens

Post by T.E.Dicke » Sun, 11 Apr 1999 04:00:00


...

Quote:> 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.

something doesn't sound quite right: the problem I would expect to see
in this case would be that your cursor position is incorrect -- but the
screen contents should be ok.  (But I'm curious - a typescript (uuencoded)
would show the details better).

Quote:> 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
> movement.

--
Thomas E.*ey

http://www.veryComputer.com/

 
 
 

vi/curses bug, AIX 4.3.2, alternate screens

Post by Michael Wojc » Mon, 12 Apr 1999 04:00:00




> ...
> > 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
> > movement.
> something doesn't sound quite right: the problem I would expect to see
> in this case would be that your cursor position is incorrect -- but the
> screen contents should be ok.  (But I'm curious - a typescript (uuencoded)
> would show the details better).

No, Dale has it right.  In a cmdtool (running on a Sun machine - AIX
is irrelevant for this test) put some output on the screen (eg. with
ls) and do a "tput smcup".  You switch screen modes and the output
disappears.  Do a "tput rmcup" and you switch back.  AIX curses is
presumably tracking the smcup/rmcup state and doing an smcup when
necessary before doing a cup.

I note that the Solaris 2.5.1 terminfo entry for sun-cmd does not
send the mode-switching code as part of cup (as we might expect -
cup should be implemented as efficiently as possible, and terminfo
is allowed to assume that smcup has been given before cup).  So it
would appear that this is indeed a bug in either curses or vi.  I
don't have a 4.3 machine to narrow it down further.

I'd recommend getting one of the superior vi clones (I like vim)
and using it instead of vi.  That should take care of the problem
and provide additional features as well.


AAI Development, MERANT                 (block capitals are a company mandate)
Department of English, Miami University

Even though there may be some misguided critics of what we're trying
to do, I think we're on the wrong path.
-- Reagan

 
 
 

vi/curses bug, AIX 4.3.2, alternate screens

Post by T.E.Dicke » Tue, 13 Apr 1999 04:00:00



>> something doesn't sound quite right: the problem I would expect to see
>> in this case would be that your cursor position is incorrect -- but the
>> screen contents should be ok.  (But I'm curious - a typescript (uuencoded)
>> would show the details better).
> No, Dale has it right.  In a cmdtool (running on a Sun machine - AIX

well, we are both guessing (but as I said - a typescript would show the
behavior without need for guessing)

--
Thomas E.*ey

http://www.veryComputer.com/

 
 
 

1. Curses alternate characters on AIX/RS6000

Is there a terminal-independent way to tell curses to draw a vertical or
horizontal line character on AIX/RS6000?  I'm most interested in doing this
on vt100.

Under SCO Unix SYSV, there are #defines in tinfo.h which define ACS_HLINE as
acs_map['q'] and ACS_VLINE as acs_map['x'].  Passing these to waddch() cause
the appropriate chaacter to be drawn if the terminal supports it.  I assume this
is using the acsc terminfo capability, which is not defined on AIX.

On AIX, the following typed at the command line will drap 3 vertical lines
and 3 horizontal lines on the vt100:
  tput font1; echo qqqxxx; tput font0
Is there a more elegant (ie. curses) way to do this?

I'd appreciate any help.

2. Problems with Sun Netra i webserver - please help

3. Curses Alternate Character Set in AIX

4. Ping problem!

5. AIX X-station screen dimmers - a bug?

6. I've fallen down and can't reach my partition

7. Curses, terminfo, vt100, Alternate character set?

8. named with virtual hosts

9. need curses with alternate character set support

10. curses curses curses

11. Alternate editor to VI. Please Stop this thread.

12. alternate screen selection in termcap

13. Long standing bug in alternate stack handling