Article View: comp.windows.x
Article #36966Re: changing titles
From: kris graham
Date: Sat, 17 Feb 1990 11:48
Date: Sat, 17 Feb 1990 11:48
75 lines
3214 bytes
3214 bytes
In article <BANNON.90Feb13134554@betelgeuse.csc.ti.com>,
bannon@betelgeuse.csc.ti.com (Tom Bannon) writes:
> In article <NIERMANN.90Feb11143721@grumpy.csg.uiuc.edu>
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
Technical Details
Message-ID:
<1581@riscy.dec.com>Path:
arc1-ca.pugleaf.net!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!grahamReferences:
<BANNON.90Feb13134554@betelgeuse.csc.ti.com> <NIERMANN.90Feb11143721@grumpy.csg.uiuc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <BANNON.90Feb13134554@betelgeuse.csc.ti.com> <NIERMANN.90Feb11143721@grumpy.csg.uiuc.edu> Sender: newsdaemon@riscy.dec.com Distribution: comp.windows.x Lines: 75