This is the mail archive of the cygwin 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: Terminal background color


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


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