Date: Fri, 29 Apr 2005 08:38:20 -0500 From: "Matthew D. Fuller" <fullermd@over-yonder.net> To: /dev/null <null@dnswatch.com> Cc: freebsd-current@freebsd.org Subject: Re: tcsh Message-ID: <20050429133820.GJ81486@over-yonder.net> In-Reply-To: <52053.216.177.243.35.1114762792.localmail@webmail.dnswatch.com> References: <427196C0.5040506@chuckr.org> <52053.216.177.243.35.1114762792.localmail@webmail.dnswatch.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <http://www.over-yonder.net/~fullermd/projects/tcshrc/>): ---------------------------------- # 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050429133820.GJ81486>