Newsgroups: comp.windows.x
Path: cantaloupe.srv.cs.cmu.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!aio!krakatoa!mccoy
From: mccoy@gothamcity.jsc.nasa.gov (Daniel McCoy)
Subject: Re: Title for XTerm
Message-ID: <1993Apr21.134409.15421@aio.jsc.nasa.gov>
Sender: news@aio.jsc.nasa.gov (USENET News System)
Reply-To: mccoy@gothamcity.jsc.nasa.gov
Organization: I-NET Inc.
References: <1r3fe2INN10d@fbi-news.Informatik.Uni-Dortmund.DE>
Date: Wed, 21 Apr 1993 13:44:09 GMT
Lines: 52

In article 1r3fe2INN10d@fbi-news.Informatik.Uni-Dortmund.DE, markhof@ls12r.informatik.uni-dortmund.de (Ingolf Markhof) writes:
|>In article <1quh74$r71@irz401.inf.tu-dresden.de>, beck@irzr17.inf.tu-dresden.de (Andre Beck) writes:
|>|> 
|>|> In article <C5oL74.3B1@aeon.in-berlin.de>, thomas@aeon.in-berlin.de (Thomas Wolfram) writes:
|>|> |> >Hey guys!
|>|> |> >I work on many stations and would like this name and current logname
|>|> |> >to be in a title of Xterm when it's open and a machine name only
|>|> |> >when it's closed. In other words, I want $HOST and $LOGNAME to appear
|>|> |> >as a title of opened XTerm and $HOST when XTerm is closed.
|>|> |> >How can I do it?
|>|> |> Almost all window managers (twm, mwm, olwm and their derivates) support
|>|> |> escape sequences for it. For your purpose put following into your
|>|> |> .login (if you're using csh or tcsh), for sh you have to modify it.
|>|> |> 
|>|> |> if ( "$term" == "xterm" ) then
|>|> |> 	echo "^[]2;${LOGNAME}@${HOST}^G^[]1;${HOST}^G"
|>|> |> endif
|>|> 1) This is NOT a feature of the Window Manager but of xterm.
|>|> 2) This sequences are NOT ANSI compatible, are they ?
|>|>    Does anyone know IF there are compatible sequences for this and what they
|>|>    are ? I would think they are DCS (device control sequence) introduced,
|>|>    but may be a CSI sequence exists, too ?
|>|>    This MUST work on a dxterm (VT and ANSI compatible), it may not work
|>|>    on xterms.
|>It works on xterms. At least I have no problem with it. - Back to the original
|>question:
|>
|>I usually start new xterms by selecting the proper menu entry in my desktop
|>menu. Here is a sample command:
|>
|>	xterm -sl 999 -n ls12i -title ls12i -e rlogin ls12i &
|>
|>The -n and -title options give the text for window and icon. As I use the
|>tcsh (a wonderful extension of the csh), I can do the following:
|>
|>I have an
|>
|>	alias precmd echo -n '^[]2\;${HOST}:$cwd^G'
|>
|>in my ~/.tcshrc. This is a special alias for tvtwm. It is executed each time
|>before printing the prompt. So, I have the current host name and the current
|>directory path in the title bar of my xterms.

Have you gotten an answer yet?  Using your variables, this is what I would do:
	xterm -T "$HOST - $LOGNAME" -n "$HOST"

---
Daniel J. McCoy           |=> SPACE  <=|                   I-NET, Inc.
NASA Mail Code PT4        |=> IS     <=|             TEL: 713-483-0950
NASA/Johnson Space Center |=> OUR    <=|             FAX: 713-244-5698
Houston, Texas 77058      |=> FUTURE <=| mccoy@gothamcity.jsc.nasa.gov

