Você pode usar o alias especial cwdcmd
. De tcsh(1)
:
cwdcmd Runs after every change of working directory. For example, if
the user is working on an X window system using xterm(1) and a
re-parenting window manager that supports title bars such as
twm(1) and does
> alias cwdcmd 'echo -n "^[]2;${HOST}:$cwd ^G"'
then the shell will change the title of the running xterm(1) to
be the name of the host, a colon, and the full current working
directory. A fancier way to do that is
> alias cwdcmd 'echo -n
"^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
This will put the hostname and working directory on the title
bar but only the hostname in the icon manager menu.
Note that putting a cd, pushd or popd in cwdcmd may cause an
infinite loop. It is the author's opinion that anyone doing so
will get what they deserve.
Eu recomendaria fazer algo assim em seu ~/.tcshrc
:
set basepath = (/sbin /bin /usr/sbin /usr/bin)
set path = ($basepath)
alias cwdcmd source ~/.tcsh/cwdcmd.tcsh
# Do this on startup as well
cwdcmd
E, em seguida, em ~/.tcsh/cwdcmd.tcsh
:
# Reset path
set path = ($basepath)
# cwd is exactly this
if ( "$cwd" == "/home/martin/code" ) then
set path = ($path /code-path)
# cwd starts with this
else if ( "$cwd" =~ "/home/martin/tmp*" ) then
set path = ($path /tmp-path)
endif