On Tue, 23 May 2000, Duncan Simpson wrote:

> void set_title(const char *t)
> {
>     char *ts;
> 
>     if (tgetent("hs") && (td=tgetstr("ts", NULL))!=NULL)
>     {
>       tputs(ts);
>       fputs(t, stdout);
>       fputc('\007', stdout);
>     }
> }

Additional remarks:

1) Shouldn't you use tiget* functions instead of tget*, or both?
   (i.e. terminfo vs termcap)

2) How do you do it in Slang, anyway?

3) Use an external program or script instead.  Avoids problems 1) and 2).

   Users who want this fancy decorative stuff shouldn't mind the
   overhead.  After all, lynx already provides a document "title" on
   the very first line.

   Better yet, somebody has already made such a helper program:

----- /usr/doc/xtermset/copyright ---
This package was debianized by Tommi Virtanen <[EMAIL PROTECTED]> on
Mon,  1 Nov 1999 20:06:46 +0200.

It was downloaded from http://xtermset.netpedia.net/

Upstream Author(s): Breyten Ernsting <[EMAIL PROTECTED]>
                    Decklin Foster <[EMAIL PROTECTED]>

Copyright:

xtermset is free software; see the file COPYING for details.
.....
--------------------------------------

and from the man page:

--------------------------------------
NAME
       xtermset - change settings of an xterm

SYNOPSIS
       xtermset [-option ...]

DESCRIPTION
       xtermset  allows  you  to change the characteristics of an
       xterm window from the command line. Most options have  the
       same  names as those that you would give xterm at startup.

OPTIONS
       -f, -force
               xtermset normally checks if you are using it on  a
               correct  terminal  (xterm  (derivative)  or dtterm
               (derivative). With this option  you  can  override
               this checking.

       -T string, -title string
               Sets the window title.

       -n string
               Sets the icon name.

.....
------------------------------------------


   Klaus


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to [EMAIL PROTECTED]

Reply via email to