Subject: Re: /root/.termcap (was Re: tried to move /usr)
To: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
From: David Brownlee <abs@anim.dreamworks.com>
List: current-users
Date: 01/25/1999 19:38:47
	As mentioned by Chris - defaulting to an arbitrary (if common)
	term variable would be a bad thing (I have a terminal that locks
	up hard if it receives certain vt100 codes).

	The 'WARNING:' line seems pretty reasonable though.

	How does:

        if ((ttype = getenv("TERM")) == NULL) {
                fprintf(stderr,"WARNING: TERM environment variable not set.\n");
                ttype = "unknown";
        }

	grab people?

		David/absolute

	 -=-  "Just adding to the wrinkles on his deathly frown"  -=-

On Sun, 24 Jan 1999, Brian C. Grayson wrote:

> On Sun, Jan 24, 1999 at 12:47:03AM -0800, David Brownlee wrote:
> > 	This is fixed in -current. It reports 'terminal type unknown'.
> > 	Have submitted a pullup request so hopefully we'll see it fixed
> > 	in 1.3.4 also (As and when that comes out :)
> 
>   Yes, while looking into fixing this I saw that the behaviour has
> changed.  However, I think the patch below is a little more
> user-friendly (newbie-friendly?  :)).  Also, I personally would
> rather the default be something _slightly_ useful, like vt100.
> 
>   Opinions?
> 
> --- cl_main.c.dist      Sat Jan 23 23:53:05 1999
> +++ cl_main.c.bcg       Sun Jan 24 00:49:03 1999
> @@ -87,8 +87,18 @@
>          * We have to know what terminal it is from the start,
>          * since we may
>          * have to use termcap/terminfo to find out how big the
>          * screen is.
>          */
> -       if ((ttype = getenv("TERM")) == NULL)
> +       /* XXX Should we also check for TERMCAP? bgrayson */
> +       if ((ttype = getenv("TERM")) == NULL) {
> +               /* XXX Would it be more useful to use vt100,
> +                *     instead of unknown? bgrayson */
>                 ttype = "unknown";
> +               fprintf(stderr,
> +                   "WARNING:  TERM environment variable was not set.\n");
> +               fprintf(stderr, "Using TERM=%s.\n", ttype);
> +               /* Allow the message to be read before the
> +                * screen clears etc. */
> +               sleep(1);
> +       }
>         term_init(gp->progname, ttype);
>  
>         /* Add the terminal type to the global structure. */
>