Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!decvax!decwrl!sun!shannon From: shannon@sun.uucp (Bill Shannon) Newsgroups: net.unix-wizards Subject: Re: Mysterious transformation of tset(1) output on Suns Message-ID: <2891@sun.uucp> Date: Mon, 14-Oct-85 03:52:55 EDT Article-I.D.: sun.2891 Posted: Mon Oct 14 03:52:55 1985 Date-Received: Tue, 15-Oct-85 06:55:09 EDT References: <483@smeagol.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 16 Within the termcap library, whenever you do a tgetent, it tries to find out the size of the current window. It does this by doing an ioctl on stdout. Almost always, when using termcap, stdout is the tty/window you're going to do termcap things to. If the ioctl succeeds, tgetent modifies the normal termcap entry to insert new "li" and "co" entries at the front (where they'll be found before the attributes in the normal termcap entry). This explains why it fails when you pipe the output through cat but succeeds in almost all real cases. Bill Shannon P.S. Not mentioned above is the fact that if the window size changes after doing the tgetent, the program must've set itself up to notice the change (catch the SIGWINCH signal) and do the ioctl itself to get the new window size.