This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: OK, I'm a newbie in CYGWIN... How to do title?
- From: "mstucky5" <mstucky5 at cox dot net>
- To: <Bruce dot A dot Petro at mail dot sprint dot com>,<cygwin at cygwin dot com>
- Date: Thu, 15 Aug 2002 18:23:01 -0400
- Subject: Re: OK, I'm a newbie in CYGWIN... How to do title?
- References: <H00029e11bcb55b5.1029276760.kcopmp04@MHS>
----- Original Message -----
From: <Bruce.A.Petro@mail.sprint.com>
To: <cygwin@cygwin.com>
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).
>
> THANKS!
> 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.
--Mark
mstucky5@cox.net
------------------------ 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: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/