[comp.sys.sgi] Changing text in wsh title bar?

dwallach@soda.Berkeley.EDU (Dan Wallach) (02/18/91)

On other systems, I have my shell put the current working directory in the
title bar of the window.  I want also to do this with my wsh'es on the Iris.

Is it possible?  We're running Irix 3.3.1 with 4Sight 1.5 (I think).
X windows doesn't currently work at all, so I can't just run an xterm.

Dan Wallach
dwallach@soda.berkeley.edu

P.S.  Please don't reference any Iris manuals.  Berkeley has decided that
those of us in the graphics classes can't be trusted with a manual set in
the Iris lab.  We'd just naturally steal them.  Sadly, I can't just RTFM.

c60244@ccfiris.aedc (Kenny McDonald) (02/18/91)

To place your current working directory in the title bar you should set
up the following in your .login file:

alias setp 'set hwd=$cwd; set prompt = "<ctrl>[[1m<\! %<ctrl>[[0m <ctrl>[P1.y${hwd} <ctrl>[\\"'

alias cd 'cd \!*; setp'



NOTE: <ctrl>[ (type the control key and the left square bracket)

<ctrl>[[1m set the text attributes to bold
<\! will place a <# in your prompt where # is the current command number
<ctrl>[[0m will set the text attributes back to normal
<ctrl>[P1.y.....<ctrl>[\\ will place the desired ... in the title bar.



NOTE: I was given the above info from an associate here at AEDC.

./

  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  | Kenneth M. McDonald * OAO Corp * Arnold Engineering Development Center |
  |          MS 120 * Arnold AFS, TN 37389-9998 * (615) 454-3413           |
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  INTERNET:                                               OO   AA   OO
  @aedc-vax.af.mil:c60244@ccfiris.aedc                   O  O A  A O  O
                                                         O  O AAAA O  O
  LOCAL:                                                 O  O A  A O  O
  c60244@ccfiris                                          OO  A  A  OO
                                                        ________________
                                                                       /

sinkwitz@ifi.unizh.ch (Rainer Sinkwitz) (02/19/91)

In article <1991Feb17.235559.674@agate.berkeley.edu> dwallach@soda.Berkeley.EDU (Dan Wallach) writes:
>On other systems, I have my shell put the current working directory in the
>title bar of the window.  I want also to do this with my wsh'es on the Iris.
>
This should be subject of a faq (freq. asked questions)
if you look at a former question:

>In <1251@acf5.NYU.EDU> sabbagh@acf5.NYU.EDU (sabbagh) writes:
>
>>After reading the "4Sight Programmers Guide" (i.e., IRTFM) I was able to
>>change the title of a wsh window.  However, I cannot seem to find out
>>how to change the title of the icon of such a window.
>
>To change the icon title:
>        echo "\033P3.yTITLE\033\\"
>
>Just for completeness, here's how to change the wsh title:
>        echo "\033P1.yTITLE\033\\"
>
>In a script, replace "TITLE" with "$!", and it will set the title to
>the first command line argument.
>
>
>--
>Vic Mitnick                Silicon Graphics, Inc.
>vic@sgi.com                System Software Division
>(415)335-1372

I use the following in my .login file: (adopted from 4Dgifts/.login)
  (pay attention to ^H's and ^G's and long "alias" line or uudecode 
   the version below)
--------------------------------begin (don't cut here, use uudecode) ----
if ($TERM == "iris-ansi"  || $TERM == "iris-ansi-net") then
    alias setp 'set hwd=$cwd:h; set prompt = "\^[P1.y< $USER@`hostname` >^[\^H<\
! /$hwd:t/$cwd:t> "'
else
  if ( $term == "xterm" ) then
    alias setp 'set hwd=$cwd:h; set prompt = "\^[]2;< $USER@`hostname` >^G<\! /$
hwd:t/$cwd:t> "'
  else
    alias setp 'set hwd=$cwd:h; set prompt = "<\! `hostname` /$hwd:t/$cwd:t> "'  endif
endif

setp
alias cd 'cd \!*; setp'
--------------------------------end

It sets the title to be user@host and puts the pathname into the prompt.
It works with wsh and xterm. 

begin 644 loginstuff
M:68@*"1415)-(#T](")I<FES+6%N<VDB("!\?"`D5$5232`]/2`B:7)I<RUA
M;G-I+6YE="(I('1H96X*("`@(&%L:6%S('-E='`@)W-E="!H=V0])&-W9#IH
M.R!S970@<')O;7!T(#T@(EP;4#$N>3P@)%5315)`8&AO<W1N86UE8"`^&UP(
M/%PA("\D:'=D.G0O)&-W9#IT/B`B)PIE;'-E(`H@(&EF("@@)'1E<FT@/3T@
M(GAT97)M(B`I('1H96X*("`@(&%L:6%S('-E='`@)W-E="!H=V0])&-W9#IH
M.R!S970@<')O;7!T(#T@(EP;73([/"`D55-%4D!@:&]S=&YA;65@(#X'/%PA
M("\D:'=D.G0O)&-W9#IT/B`B)PH@(&5L<V4*("`@(&%L:6%S('-E='`@)W-E
M="!H=V0])&-W9#IH.R!S970@<')O;7!T(#T@(CQ<(2!@:&]S=&YA;65@("\D
M:'=D.G0O)&-W9#IT/B`B)PH@(&5N9&EF"F5N9&EF"@IS971P"F%L:6%S(&-D
0("=C9"!<(2H[('-E='`G"@H@
`
end

Rainer Sinkwitz            | E-mail: sinkwitz@ifi.unizh.ch
Dept. of Computer Science  |     {backbone}!mcsun!unizh!sinkwitz
University of Zuerich      |         K114970@CZHRZU1A.bitnet

-- 

Rainer Sinkwitz            | E-mail: sinkwitz@ifi.unizh.ch
Dept. of Computer Science  |     {backbone}!mcsun!unizh!sinkwitz
University of Zuerich      |         K114970@CZHRZU1A.bitnet