Re: tcsh

From: Matthew D. Fuller <fullermd_at_over-yonder.net>
Date: Fri, 29 Apr 2005 08:38:20 -0500
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_at_' 
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_at_${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.
Received on Fri Apr 29 2005 - 11:38:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:33 UTC