csh is root's shell?
Julian Elischer
julian at elischer.org
Fri Oct 8 12:34:43 PDT 2004
Alexey Dokuchaev wrote:
>On Thu, Oct 07, 2004 at 09:44:52AM -0700, Don Lewis wrote:
>
>
>>This is what I use:
>>
>> set prompt = '%m:%c4 %h%#'
>> if ($?TERM && $TERM == xterm) then
>> set prompt='%{\033]0;%n@%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.
>>
>>
>
>I use pretty much the same code for setting xterm's titlebar. However,
>there is one known problem with it: when you leave (^D) your shell,
>being ssh'ed to another machine, titlebar still has that remote host
>name. If there was a way to retrieve current title string, sigh.
>Unless, of course, I'm missing something here.
>
alias ssh ssh_wrapper
and define ssh_wrapper to be
ssh $* ; settitle.
(where settitle dos the above sequence for settingthe xterm title)
in sh I'd use a sh function..
in csh I use:
if ("$TERM" == "xterm") then
alias hdr 'echo -n "^[]2;\!*^G"'
alias ihdr 'echo -n "^[]1;\!*^G"'
alias newhdr 'hdr "${user}@${hostname}:$cwd"'
alias newihdr 'ihdr "${hostname}"'
newihdr
alias p 'newhdr; set prompt="${user}@${hostname}:"'
else
alias p 'set prompt="$USER@${hostname}:$cwd:t(\\!) " '
endif
alias cd 'cd \!*; p'
alias chdir 'chdir \!*; p'
alias pushd 'pushd \!*; p'
alias popd 'popd \!*; p'
alias ssh 'ssh \!*; p'
p
>
>./danfe
>_______________________________________________
>freebsd-current at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"
>
>
More information about the freebsd-current
mailing list