This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OK, I'm a newbie in CYGWIN... How to do title?

----- Original Message -----
From: <>
To: <>
Sent: Tuesday, August 13, 2002 6:12 PM
Subject: OK, I'm a newbie in CYGWIN... How to do title?

> I promise, I checked the archives and docs and don't see anything on
> this...
> Can someone share how I perform the equivalent of the NT 'title'
> command on a CYGWIN window??   I've got 4-6 CYGWIN windows open - each
> tailing a certain log file.  Only problem is its not obvious which
> window is which log file!  What I need is to do something like:
> $title "Logfile1"
> tail -f logfile1.log
> Hey, while I've got your attention - one more question.  Does anyone
> know where I can download (or compile) a version of sendtcp to run
> under NT (Sorry, can't run under CYGWIN, must run under NT scripts).
> Bruce.

Here's a little routine that I found somewhere years ago...

Just compile it as

   gcc -o title title.c

and put "title.exe" in your path...

It works for me whether I'm in a "standard bash console" window
or in an "rxvt" window.


------------------------ title.c -----------------------
#include <stdio.h>

* This program takes the input string and puts it into the
* the xterm title.  If you change the value of the first
* number in the printf statement, you can determine where
* the string will go.  You can use either 0, 1, or 2.  0
* puts it in the title of the xterm; 1 puts it into the
* the icon name, and 2 does both.

main(argc, argv)
int argc; char *argv[];
        char buff[512];

        argv++; argc--;
        buff[0] = '\0';
        while (argc--) {
                strcat( buff, *argv++ );
                strcat( buff, " " );
        buff[strlen(buff)-1] = '\0';
        printf( "%c]0;%s%c", (char)27, buff, (char)7 ); fflush(stdout);

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]