tcsh
Matthew D. Fuller
fullermd at over-yonder.net
Fri Apr 29 06:38:23 PDT 2005
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 at over-yonder.net
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.
More information about the freebsd-current
mailing list