[comp.unix.questions] Alternate characters at bottem right hand corner.

theo@wiggles.UUCP (T. Kramer) (06/25/90)

How do I get an alternate character at the bottem right hand corner of
either the SCO Xenix ansi or dec vt100 terminals using curses? I want to
place a bottem right hand corner character at row 25 column 80 for an ansi
terminal or row 24 column 80 for a vt100 terminal. All other positions on
the screen work fine.

When using the tput smacs command it works ok but not via a c program that
uses curses to switch the terminal into alternate character mode.

Has anybody out there got a solution?

gwyn@smoke.BRL.MIL (Doug Gwyn) (06/27/90)

In article <1344@wiggles.UUCP> theo@wiggles.UUCP (T. Kramer) writes:
>Has anybody out there got a solution?

You're not supposed to try to place a character at the LRC, for obvious
reasons.  However, on terminals that support character (or, yuck, line)
insertion, you can achieve the same effect by building a last line with
some earlier character left out, then insert the left-out character to
shift the rest of the line over.

leo@ehviea.ine.philips.nl (Leo de Wit) (06/28/90)

(Mail to T. Kramer failed; phigate!nluug.nl!MAILER-DAEMON says:
554 theo@wiggles... undomained host not known : wiggles)

In article <13250@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
|In article <1344@wiggles.UUCP> theo@wiggles.UUCP (T. Kramer) writes:
|>Has anybody out there got a solution?
|
|You're not supposed to try to place a character at the LRC, for obvious
|reasons.

I suppose by 'obvious reasons' you meant the scrolling of the display;
this depends on the type of terminal, and the mode it is in (automargin
on/off). For instance, on a vt220 you _can_ place a character at the
LRC. The following test program was run both with BSD curses and AT&T
curses (on a Pyramid):

#include <curses.h>

main()
{
	initscr();
        scrollok(stdscr,TRUE);
        clear();
        box(stdscr,'|','-');
        refresh();
	getch();
	endwin();
}

Results for a vt220: both versions use the LRC, the AT&T one uses the
enter insert mode (smir) sequence to accomplish this, it also ends each
line - except the last - with a carriage return (which is bogus IMHO,
since the terminfo entry has the 'am' capability).

Results for a vt100 (which doesn't have an insert character or enter
insert mode capability): the BSD version places a character at the LRC,
the AT&T version doesn't.  If you leave out the scrollok(), it makes no
difference for the AT&T version, the BSD version however doesn't use
any of the corners anymore (for the box()). Even if you create a
terminfo entry for a 'vt100 without automargin', AT&T curses refuses to
use the LRC.

|          However, on terminals that support character (or, yuck, line)
|insertion, you can achieve the same effect by building a last line with
|some earlier character left out, then insert the left-out character to
|shift the rest of the line over.

Unfortunately, the vt100 (one of the terminals this was asked for)
doesn't support character insertion.

    Leo.

gwyn@smoke.BRL.MIL (Doug Gwyn) (07/04/90)

In article <808@ehviea.ine.philips.nl> leo@ehviea.UUCP (Leo de Wit) writes:
>Unfortunately, the vt100 (one of the terminals this was asked for)
>doesn't support character insertion.

The VT100 does support line insertion (via manipulation of the scrolling
region), and thus the technique I described can be used.  You must of
course build the entire  desired last line somewhere other than on the
last line of a scrolling region that includes the bottom display line,
then scroll in reverse to move the desired last line to the bottom of
the display, then fill in the vacated top line or lines of the scrolling
region.  This is a lot of work simply to use one cell location, and most
applications don't bother to use that location (a much simpler solution).
If I recall correctly, a genuine VT100 doesn't scroll at the end of a
line until the next character is received and is found to be other than a
carriage-return, but the exact VT100 behavior is very quirky (there are
several bugs in the microcode) and impossible to correctly describe using
termcap/terminfo.  In particular, "am" is never correct for a VT100.