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
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.

< 1K Download

 Sat, 09 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
In article <>,
Joshua M. Dobies <> wrote:

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

Christian "naddy" Weisgerber        
    carpe librum: books 'n' reviews <URL:>

 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

% 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
        # got one
        set wname=`xwininfo -id $wid | grep xwininfo | awk '{print $5}'`
        if ("$wname" == "") then
                # another error of some sort
                # error handling code here
                echo "$wname"
##### 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

 Wed, 13 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
In article <7632sm$>,

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.


 Fri, 15 Jun 2001 03:00:00 GMT   
 GETTING xterm title from tcsh
On 28 Dec 1998 09:52:06 GMT, Veksler Michael <>


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  <>

 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