It is currently Tue, 07 Dec 2021 02:03:01 GMT



 
Author Message
 GETTING xterm title from tcsh

I've recently learned that you can set the title of an xterm from tcsh.
Very cool.
    echo "^[]2;<title>^G"
    where ^[ = the Esc key,
              ^G = Ctrl-g.
    note: you may have to type Ctrl-V first before typing Esc or Ctrl-g.

    (source: "Using csh & tsch", Paul Dubois, O'Reilly and Associates
Inc.")
BUT....
I want to know if there's a way to GET the current title of an xterm
window so I can save it in the environment before setting it.
Thanks.

  vcard.vcf
< 1K Download


 Sat, 09 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
In article <36803D90.21390...@us.oracle.com>,
Joshua M. Dobies <jdob...@us.oracle.com> wrote:

Unless I missed something, xterm doesn't support a way to return the
window title to the application.

--
Christian "naddy" Weisgerber                  na...@mips.rhein-neckar.de
    carpe librum: books 'n' reviews <URL:http://www.carpe.com/buch/>



 Wed, 13 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh

Not directly, but you can get it with a bit of work:
------
% printenv
DISPLAY=:0.0
HELPPATH=/usr/openwin/lib/locale:/usr/openwin/lib/help
HOME=/users/gherbert
HZ=100
LANG=C
LOGNAME=gherbert
...
WINDOWID=88080397

% xwininfo -id 88080397

xwininfo: Window id: 0x540000d "gondwana"

Absolute upper-left X:  125
Absolute upper-left Y:  146
...
-----

So you just have to do something like:

#!/bin/csh -f
##### begin getwname
# get window info
set wid=`printenv WINDOWID`
if ("$wid" == "") then
        # don't have a window we can identify
        # error handling code here
else    
        # got one
        set wname=`xwininfo -id $wid | grep xwininfo | awk '{print $5}'`
        if ("$wname" == "") then
                # another error of some sort
                # error handling code here
        else
                echo "$wname"
        endif
endif
##### end getwname

The above returns the name in quotes, but a simple sed to remove
the quotes could be added inside, or externally.

-george william herbert
gherb...@crl.com



 Wed, 13 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
In article <7632sm$nn...@mips.rhein-neckar.de>,

It has to be possible.  The window managers can do it.
xwininfo can do it.



 Thu, 14 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh

You should remember that this will not work over ssh, rlogin or telnet.

   Michael



 Fri, 15 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
On 28 Dec 1998 09:52:06 GMT, Veksler Michael <mveks...@technion.ac.il>
wrote:

With

echo -n "\e[21t"

you get xterm to print the title (along with some escape sequences)
into the terminal. I have no idea if it is possible to capture it into
a shell variable.

--
Falk Hueffner  <falk.hueff...@student.uni-tuebingen.de>



 Thu, 21 Jun 2001 03:00:00 GMT   
 
   [ 6 post ] 

Similar Threads

1. setting xterm title in tcsh

2. tcsh xterm title bar quoting

3. Using tcsh prompt string in xterm title

4. display pwd in xterm title bar with tcsh

5. Dynamically changing xterm title bar in tcsh

6. xterm titles in tcsh (or csh)

7. Getting the title of an Xterm

8. Getting the xterm title


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software