From: rab@ariel.ucs.unimelb.edu.au (Duty Programmer)
Newsgroups: comp.mail.elm,comp.unix.aix
Subject: Re: elm2.4, AIX
Date: 12 Oct 92 01:32:00 GMT
Reply-To: rab@tauon.ph.unimelb.EDU.AU
Followup-To: comp.mail.elm
Organization: School of Physics, University of Melbourne


In article <1992Oct9.104230.28204@newssrv.edvz.univie.ac.at>, tom@bim.itc.univie.ac.at (Tom Kovar) writes:
|> syd@DSI.COM (Syd Weinstein) writes:
|> but attention - I have already seen AIX systems, where the file /etc/termcap
|> was missing - in that case, -ltermcap won't work, right. (Even if AIX docu

I hit this problem, but there should be a termcap in /lib/libtermcap/libtermcap.src
(why IBM put it there i don't know), so you can make a symbolic link to it.

All this talk of TERMCAPs and TERMINFO has avoided the only snag i hit with elm,
which is a consequence of AIX being more system V-like while emulating the BSD
TERMCAP stuff. I'm amazed noone has complained about this: it hit us immediately,
and i received little interest from this group when i posted earlier in the year.
(Admittedly this was with elm 2.3 PL11, so i hopefully i'm talking about something
that's still relevant).

The problem is that when using an xterminal, the screen size is a dynamically
changing entity. MIT provides a "resize" command that puts the new screen size
in the user's environment so that programs can find out how many lines and columns
are currently being used.

[Excerpt from my old post:]
As an xterm has dynamically changing #co and #li values, the termcap
library routines will work fine if the TERMCAP environment variable
has the actual text for the appropriate entry, complete with #co and
#li filled in.

Putting the current screen size into the environment is exactly what
the X11 'resize' command is for... However, the output of this command
depends upon whether you compile it for a SystemV or not. If you DON'T,
then you get the complete termcap entry as your TERMCAP variable. If
you DO, then 'resize' just sets the values for LINES and COLUMNS in
your environment.

There are obviously two ways out of this predicament (for me):

	1. Recompile 'resize' with -USYSV
	2. Modify the ELM source code in curses.c, viz.:


> #ifdef SYSV
> 
>         /*
>         ** SysV 'resize' command sets environment
>         ** variables for lines and columns
>         */
> 
>         if( sscanf(getenv("LINES"), "'%d'", &_lines) != 1 )
>            _lines          = tgetnum("li");
>         if( sscanf(getenv("COLUMNS"), "'%d'", &_columns) != 1 )
>            _columns        = tgetnum("co");
> #else
>         _lines             = tgetnum("li");
>         _columns           = tgetnum("co");
> #endif
> 

(Note that there was never any checking for sensible values of lines
and columns.)

So my question really is this: is this the right thing to do ? I'm assuming
that 'resize' does the correct thing, so that modifying the elm source code
to deal with this is appropriate.

rab
------------------------------------------------------------------------
Richard Brown                     | E-mail: rab@tauon.ph.unimelb.EDU.AU
School of Physics                 | Phone : +61 3 344 5081
University of Melbourne           | Fax   : +61 3 347 4783
Parkville Victoria AUSTRALIA 3052 | Telex : AA35185
Newsgroups: comp.mail.elm