Subject: Re: /root/.termcap (was Re: tried to move /usr)
To: David Brownlee <abs@anim.dreamworks.com>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: current-users
Date: 01/24/1999 15:28:08
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. */