Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!dogie.macc.wisc.edu!decwrl!shlump.nac.dec.com!riscy.dec.com!fuel.dec.com!graham From: graham@fuel.dec.com (kris graham) Newsgroups: comp.windows.x Subject: Re: changing titles Message-ID: <1581@riscy.dec.com> Date: 17 Feb 90 11:48:21 GMT References: Sender: newsdaemon@riscy.dec.com Distribution: comp.windows.x Lines: 75 In article , bannon@betelgeuse.csc.ti.com (Tom Bannon) writes: > In article niermann@grumpy.csg.uiuc.edu (Tom Niermann) writes: > > > Is there a way to change the name displayed in the title bar from the command > > line ? > > > This could be done in sunwindows and was useful for displaying the current > > directory and machine logged into by aliasing rlogin and cd. > > I got this off the net awhile ago (comp.windows.x, from graham@fuel.dec.com > (kris graham)) and modified it a bit to suit my tastes. By aliasing certain > commands you can get your current working directory in your xterm title bars, > which I find very nice. Here is another example that shows how to customize DECwindows dxterms (a more powerful terminal emulator than xterm) and xterms, plus, not losing your titles when you go in and out of rlogin, decnet, su, etc... BTW:This was tested on ULTRIX systems with .cshrc and X11. # if (! $?0) then # we've been run from a login session echo running .cshrc # my favorite aliases here ..... #........ #............ if ($?TERM) then if ($TERM == xterm) then stty dec pass8 echo "initializing xterm" setenv HOSTNAME `hostname` echo -n "]0;"${HOSTNAME}"::"${cwd}"" alias title 'echo -n "]0;"\!*"" ' 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}"" ' alias dlogin 'echo -n "]0;"\!*"::";/usr/bin/dlogin \!*; echo -n "]0;"${HOSTNAME}"::"${cwd}"" ' endif if ($TERM == 'vt200') then stty dec echo "initializing DECterm" setenv HOSTNAME `hostname` /usr/new/wtitle "${HOSTNAME}::${cwd}" alias title 'wtitle "${HOSTNAME}::$cwd" `tty`' alias cd 'cd \!*; wtitle "${HOSTNAME}::${cwd}" "${HOSTNAME}::${USER}"' alias pushd 'pushd \!*; wtitle "${HOSTNAME}::${cwd}"' alias popd 'popd \!*; wtitle "${HOSTNAME}::${cwd}"' alias rlogin 'wtitle \!*"::";/usr/ucb/rlogin \!*; wtitle "${HOSTNAME}::${cwd}"' alias dlogin 'wtitle \!*"::";/usr/bin/dlogin \!*; wtitle "${HOSTNAME}::${cwd}"' title endif endif endif ------------------ Christopher Graham Digital Equipment Corp Ultrix Resource Center New York City Internet: graham@fuel.enet.dec.com UUCP: ...!decwrl!fuel.enet.dec.com!graham