Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: Stuart.Marks@eng.sun.COM (Stuart Marks) Newsgroups: comp.windows.x Subject: Re: escape sequence to change title? Message-ID: <9105171949.AA18629@trantor.Eng.Sun.COM> Date: 17 May 91 19:49:00 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 47 Yes, it most certainly will work, if you are using an xterm. It could care less what window server it was running on. *8-) However, it *won't* work for cmdtool or such nonsense, which are brain dead anyways. You can indeed use escape sequences to change the title string for cmdtool and shelltool. The escape sequences do differ, though, so you'll have to put some smarts into your shell customization file to make this work if you intend to switch between xterm and cmdtool. Here are the ksh-isms that I use: case $TERM in sun*) # Escape sequences for shelltool/cmdtool: # \e]l...\e\ sets window title # \e]L...\e\ sets icon label titleprefix="$(print -n '\033]l')" titlesuffix="$(print -n '\033\')" iconprefix="$(print -n '\033]L')" iconsuffix="$(print -n '\033\')" ;; xterm*) # Escape sequences for xterm: # \e]0;...^G sets both icon and window # \e]1;...^G sets icon label # \e]2;...^G sets window title titleprefix="$(print -n '\033]2;')" titlesuffix="$(print -n '\007')" iconprefix="$(print -n '\033]1;')" iconsuffix="$(print -n '\007')" ;; *) ;; esac function posttitle { print -n "${titleprefix}${1}${titlesuffix}" ; } function posticon { print -n "${iconprefix}${1}${iconsuffix}" ; } function postboth { posttitle "$1" ; posticon "$1" ; } Enjoy, s'marks Stuart W. Marks ARPA: smarks@eng.sun.com Windows & Graphics Software UUCP: sun!smarks Sun Microsystems, Inc.