delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/15/18:25:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <011201c244aa$53c5db80$0f700944@ri.cox.net>
From: "mstucky5" <mstucky5 AT cox DOT net>
To: <Bruce DOT A DOT Petro AT mail DOT sprint DOT com>, <cygwin AT cygwin DOT com>
References: <H00029e11bcb55b5 DOT 1029276760 DOT kcopmp04 AT MHS>
Subject: Re: OK, I'm a newbie in CYGWIN... How to do title?
Date: Thu, 15 Aug 2002 18:23:01 -0400
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

----- Original Message -----
From: <Bruce DOT A DOT Petro AT mail DOT sprint DOT com>
To: <cygwin AT cygwin DOT 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 AT cox DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019