From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078728412235.tru64-unix-managers.marc@archive.invalid> From: David Stern Date: Fri, 27 Nov 1998 14:38:04 +0000 To: tru64-unix-managers Subject: SUMMARY: DECterm title/icon X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078728412235 Original question: >I'm looking for the escape sequence to set the title bar and icon >of a DECterm. The one I use for xterms ( ]0;"STRING-I_WANNA-SET ) >doesn't seem to work. > >BEFORE you answer, I know this can be done from the windows pull-down-menu >but I want a script to do this and I looked in the alpha-osf-managers archive >and pulled up: > >[]2L STRING-I_WANNA-SET [\ > >Which doesn't work. Worse, it hangs the window st I have to kill it and >create another Decterm. BTW, I notice that my TERM variable is defined >as vt300. Does that make a difference? Thanks to the many who responded including: Randy Rodgers A. Mahendra Rajah, System Manager" Stephen Hagan Pirie Hart Peter Stern Lucio Chiappetti I munged what I already had with answers from the above to get the following script.I know I'm not consistant in how I echo out the escape in each stanza of my case statement; this just shows the many different ways of doing things in unix. Also, this suffices for me but I only care about Irix, Xterm and Decterms. To be complete, I included Lucio Chiappetti's script as well: #!/bin/sh # Xtitle.sh -- Set X Title bar # ---------------------------------------------------------------------- if [ $# -lt 1 ] then echo "$0: ERROR: Usage is: $0 " exit 1 fi ESC= BEL= case $TERM in vt300) y=`printf "\235 21; %s \234" $1` # For window echo $y y=`printf "\235 2L; %s \234" $1` # for window icon echo $y exit ;; iris-ansi) echo "\033]2;$1\007\c" echo "\033]1;$1\007\c" ;; *) echo ${ESC}"]0;"${1}${BEL} #/* ICON & WINDOW NAME */ # echo ${ESC}"]1;"${1}${BEL}; #/* ICON NAME ONLY */ # echo ${ESC}"]2;{1}${BEL}; #/* WINDOW NAME ONLY */ # echo ${ESC}${1}${ESC}"; #/* Open Windows CMD Tool */ esac exit ------------------------------------------------------------------------------- ---------------------------------------------------------------------------- Lucio Chiappetti - IFCTR/CNR - via Bassini 15 - I-20133 Milano (Italy) ---------------------------------------------------------------------------- Fuscim donca de Miragn E tornem a sta scio' in Bregn Che i fachign e i cortesagn Magl' insema no stagn begn Drizza la', compa' Tapogn (Rabisch, II 41, 96-99) ---------------------------------------------------------------------------- For more info : http://www.ifctr.mi.cnr.it/~lucio/personal.html ---------------------------------------------------------------------------- #! /bin/csh -f # # issue escape sequence to annotate window banner # # first get unqualified hostname and terminal name # set a = `hostname` set b = `tty` set aa = `echo $a | tr . '\040'` set bb = $b:t # # construct escape sequences to be used # set escape = ^[ switch ($TERM) # # vt300/200/100 are for dxterm on DECs case vt300: set title = ( ${escape}]21\;Host $aa[1] : user $USER on terminal $bb${escape}\\ ) set icon = ( ${escape}]2L\;$bb $aa[1]${escape}\\ ) breaksw case vt200: set title = ( ${escape}]21\;Host $aa[1] : user $USER on terminal $bb${escape}\\ ) set icon = ( ${escape}]2L\;$bb $aa[1]${escape}\\ ) breaksw case vt100: if ( ! $?WINDOW_ME) then set title = ( ${escape}]21\;Host $aa[1] : user $USER on terminal $bb${escape}\\ ) set icon = ( ${escape}]2L\;$bb $aa[1]${escape}\\ ) else # however vt100 is also te100tool on Sunview set title = ( ${escape}]lHost $aa[1] : user $USER on terminal $bb${escape}\\ ) endif breaksw # this is for Sunview and Openwindows stuff case sun-cmd: set title = ( ${escape}]lHost $aa[1] : user $USER on terminal $bb${escape}\\ ) breaksw # and this is for xterm anywhere case xterm: set bell = ^G set title = ( ${escape}]0\;Host $aa[1] : user $USER on terminal $bb${bell}\\ ) breaksw # dtterm is probably # set title = ( ${escape}]2\;Host $aa[1] : user $USER on terminal $bb${bell} ) # set icon = ( ${escape}]1\;$bb $aa[1]${bell} ) # any other terminal is not recognized default: exit endsw # # finally issue using appropriate command for Sun or DEC # if ($DECSTATION) then echo $title if ($?icon) then echo $icon endif else /usr/5bin/echo $title endif =-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=-=-= David Stern Flight Dynamics dave@davka.gsfc.nasa.gov Goddard Space Flight Ctr Building 23 Room S226 301-286-9786