X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Andrew Schulman <schulman.andrew@epamail.epa.gov>
Subject:  Re: Naming Cygwin Shells
Date:  Tue, 09 Oct 2007 05:50:20 -0400
Lines: 22
Message-ID:  <qrimg31ohe64navq8lasqjg8ldtb98gu1t@4ax.com>
References:  <13109737.post@talk.nabble.com>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
X-Archive: encrypt
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> 
> Simple question here. I am trying to figure out a way to name a cygwin shell
> so that I can have multiple windows up doing tails and other such functions
> and easily see what system i am looking at. 

See the section on PROMPTING (and also the PROMPT_COMMAND variable) in the
bash manual for general information about what you can put in your bash
prompt.  To make some of that information go up into the window title, precede
it by the magic incantation '\[\033]0;\]' and follow it by '\[\007\]'.  I
can't remember where I learned this information.  For example,

start_window_title='\[\033]0;\]'
end_window_title='\[\007\]'
PS1="${start_window_title}\w${end_window_title}\$"

would give you the current working directory (\w) in the title bar.

I'm not sure how you'd get the name of the command that's currently executing
into the title bar, but it probably could be done.

Good luck,
Andrew.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

