Re: csh is root's shell?

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Thu, 7 Oct 2004 13:13:25 -0700 (PDT)
On  7 Oct, John Baldwin wrote:
> On Thursday 07 October 2004 12:44 pm, Don Lewis wrote:

>> This is what I use:
>>
>>         set prompt = '%m:%c4 %h%#'
>>         if ($?TERM && $TERM == xterm) then
>>                 set prompt='%{\033]0;%n_at_%m:%c5\007%}%m:%c %h%#'
>>         endif
>>
>> It adds the last few components of $cwd and the history event number to
>> the prompt.  When running in an xterm, it puts the username, hostname,
>> and the last part of $cwd in the xterm title.
> 
> You can use the precmd alias for that.  Here's my .tcshrc.interactive file 
> that I use for interactive sessions:

> set prompt="\n[%B%P%b] (%l) %B%n_at_%m%b:%.03\n%# "

> if (($term =~ xterm*) || ($term == eterm)) then
> 	alias precmd 'echo -n "]2;${USER}_at_${HOST}:$cwd"'
> 	# XXX - stupid tcsh processes this for subshells!
> 	#alias jobcmd 'echo -n "]2;${USER}_at_${HOST}:$cwd - \!#"'
> 	#cwdcmd
> endif

I don't see any advantage to using precmd for this at least one
disadvantage -  with precmd, you can't use %c# to limit the length of
the path printed in the title.  It looks like cwdcmd would be a useful
optimization if there was some way to handle exiting or suspending a
remote shell session.
Received on Thu Oct 07 2004 - 18:13:39 UTC

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