Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!deccrl!news.crl.dec.com!shlump.nac.dec.com!riscy.enet.dec.com!fuel.dec.com!graham From: graham@fuel.dec.com (graham) Newsgroups: comp.windows.x Subject: Re: Current directory in the title bar.. Message-ID: <1822@riscy.enet.dec.com> Date: 11 Dec 90 02:19:58 GMT References: <1990Dec5.014338.22560@vicom.com> Sender: newsdaemon@riscy.enet.dec.com Distribution: na Lines: 45 > Subject: Current directory in the title bar.. > Date: 5 Dec 90 01:43:38 GMT > > Is there a way to display the current directory in the title bar of the > xterm. Try the following with a C Shell. Tested on RISC/ULTRIX only. if (! $?0) then # we've been run from a login session echo running .cshrc # if ($?TERM) then if ($TERM == xterm) then stty dec echo "initializing xterm" # # save our hostname # setenv HOSTNAME `hostname` # # update the title right now # echo -n "]0;"${HOSTNAME}"::"${cwd}"" # # alias to set the title freely # alias title 'echo -n "]0;"\!*"" ' # # alias cd, pushd, popd to update the title bar with dir and host # alias cd 'cd \!*; echo -n "]0;"${HOSTNAME}":"${cwd}"" ' alias pushd 'pushd \!*; echo -n "]0;"${HOSTNAME}":"${cwd}"" ' alias popd 'popd \!*; echo -n "]0;"${HOSTNAME}":"${cwd}"" ' alias rlogin 'echo -n "]0;"\!*":";/usr/ucb/rlogin \!*; echo -n "]0;"${HOSTNAME}":"${cwd}"" ' endif # Christopher Graham Internet: graham@fuel.enet.dec.com Digital Equipment Corp UUCP: ...!decwrl!fuel.enet.dec.com!graham Ultrix Resource Center New York City