*BSD News Article 67104


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!metro!metro!asstdc.scgt.oz.au!nsw.news.telstra.net!act.news.telstra.net!vic.news.telstra.net!news.mira.net.au!news.vbc.net!news.cais.net!nntp.primenet.com!news.asu.edu!ennfs.eas.asu.edu!cs.utexas.edu!math.ohio-state.edu!howland.reston.ans.net!Germany.EU.net!Dortmund.Germany.EU.net!interface-business.de!usenet
From: j@ida.interface-business.de (J Wunsch)
Newsgroups: comp.unix.bsd.misc
Subject: Re: Help! How do I set my prompt?
Date: 29 Apr 1996 09:50:39 GMT
Organization: interface business GmbH Dresden
Lines: 30
Message-ID: <4m23df$p1i@innocence.interface-business.de>
References: <317E4568.62C0@cyclesak.com>
  <4lqbrf$c7k@innocence.interface-business.de>
  <pmh.830720362@ardbeg.islay.sub.org>
Reply-To: joerg_wunsch@interface-business.de (Joerg Wunsch)
NNTP-Posting-Host: ida.interface-business.de
X-Newsreader: knews 0.9.6

pmh@ardbeg.islay.sub.org (Patrick M. Hausen) writes:

>>Modern shells (tcsh, bash) allow for a much more sophisticated prompt
>>string, so your wishes should easily be accomplished there.  For
>>example, all my xterms display the $cwd in their window title.
>
>.... as do mine, but why don't you give him your .bashrc code?

'cause i don't use bash myself. :-)

Just in case, here's my .cshrc snippet:

if ($?prompt) then
	# an interactive shell...
	...
	if ($?DISPLAY) set prompt = "%{^[]1;%m^G^[]2;%m:%~^G%}%n@%m %h%% "
endif

(Like Paddy, i've also converted <esc> and <bel> to ^[ and ^G for the
sake of the News transport software.)

The above writes a prompt like ``j@ida 123% '', and updates the xterm
window title to display the hostname and $cwd, and the icon title to
display the hostname (so you know which icon to click for a particular
machine).

-- 
J"org Wunsch					       Unix support engineer
joerg_wunsch@interface-business.de       http://www.interface-business.de/~j