delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/24/17:57:16

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: Terminal background color
Date: Fri, 24 Nov 2006 17:56:59 -0500
Message-ID: <31DDB7BE4BF41D4888D41709C476B657041693CC@NIHCESMLBX5.nih.gov>
In-Reply-To: <003d01c70fe8$31596540$0a00a8c0@s3000p>
From: "Buchbinder, Barry \(NIH/NIAID\) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
To: "cygwin" <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id kAOMvCSC019302

David Christensen wrote on Friday, November 24, 2006 11:47 AM:

> Deluigi Marcus wrote:
>> ... which window is logged on on which machine.
> 
> I include the hostname in my Bash prompt:
> 
> 	2006-11-24 08:06:17 dpchrist AT s3000p ~
> 	$ grep PS1 .bash_profile
> 	export PS1='\D{%Y-%m-%d %H:%M:%S} \u@\h \w\n\$ '

Related, though not responsive to the OP's question, I include a
variable, "ShellLevel", in PS1, which is set in .bashrc.
	ShellLevel="$(/bin/tty | /bin/tr -dc '0-9').$((${SHLVL}-1))"
That puts a number of the form X.Y in the prompt, where X is unique for
each window and Y increments by 1 for each subshell.  I can keep track
of windows and know whether or not typing "exit" will make the window
disappear.  If I've only one window open and no subshells, the prompt
looks like this:
	0.0 /c>
(I've also got "\w" (the current working directory) in the prompt.)

--
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/


- Raw text -


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