From owner-freebsd-current@FreeBSD.ORG Fri Apr 29 13:38:23 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C03F16A4CE for ; Fri, 29 Apr 2005 13:38:23 +0000 (GMT) Received: from mortis.over-yonder.net (adsl-12-42-198.jan.bellsouth.net [65.12.42.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19CFA43D53 for ; Fri, 29 Apr 2005 13:38:22 +0000 (GMT) (envelope-from fullermd@over-yonder.net) Received: by mortis.over-yonder.net (Postfix, from userid 100) id CB1FC20F21; Fri, 29 Apr 2005 08:38:20 -0500 (CDT) Date: Fri, 29 Apr 2005 08:38:20 -0500 From: "Matthew D. Fuller" To: /dev/null Message-ID: <20050429133820.GJ81486@over-yonder.net> References: <427196C0.5040506@chuckr.org> <52053.216.177.243.35.1114762792.localmail@webmail.dnswatch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52053.216.177.243.35.1114762792.localmail@webmail.dnswatch.com> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.9i-fullermd.2 cc: Chuck Robey cc: freebsd-current@freebsd.org Subject: Re: tcsh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2005 13:38:23 -0000 On Fri, Apr 29, 2005 at 01:19:51AM -0700 I heard the voice of /dev/null, and lo! it spake thus: > > > > set prompt="%m:%{^[[34m%}`id -nu`%{^[[0m%}:%~:%{^[[31m#%h^[[0m%}%#" > > alias cd 'cd \!*;set prompt="%m%{^[[32m%}:`id > > -nu`%{^[[0m%}:%~:%{^[[31m#%h^[[0m%}%#"' > > > > FWIW here's mine: > set prompt = "\n%~\n%t\n%d, %D `/bin/hostname -s`# " > Short and sweet. As you can see it leaves little doubt as to where I am or > what day and time it is. As long as we're comparing, mine varies depending on what's in the config file (see ): ---------------------------------- # Test: should we use full domain, or just hostname? if( "$DOMAIN_PROMPT" == "YES" ) then setenv DP '%M' else setenv DP '%m' endif # Username? if( "$USER_PROMPT" == "YES" ) then setenv UP '%n@' else setenv UP '' endif if( "$CUSTOM_PROMPT_ENABLE" == "YES" ) then set prompt="$CUSTOM_PROMPT" else if( "$ROOT_PROMPT_TEST" == "YES" && $EUID == 0 ) then #set prompt="{%~} root@${DP}: %%" set prompt="${DP}:%/\n%Broot%%%b " else # This yields [time] hostname:cwd \n(tty):{line#}% set prompt="%B[%P]%b ${UP}${DP}:%~\n(%l):{%h}%% " endif endif ---------------------------------- On most systems, I turn $DOMAIN_PROMPT and $USER_PROMPT on to remind me, but on my box I leave both off. The result for me as a normal user is: [8:35:10] mortis:~ (ttypd):{1573}% and as root mortis:/root root% Note that the time on the former, and the 'root%' on the latter, are bolded. It IS, as well, intentional that my normal prompt uses %~, which displays the current dir with appropriate ~'s for homedirs, while roots prompt uses %/ which does not. Avoids confusion, IMO... -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.