It is currently Thu, 20 Jan 2022 03:46:49 GMT



 
Author Message
 Change xterm title bar?
How does one change the text in the title bar of an xterm (or nxterm)
launched on the fly from the command line of another xterm?

Per 'man xterm', I tried 'xterm -T <string>' and 'xterm -title <string>'
but neither has any effect - the title bar continues to display
'<user>@<hostname>:<pwd>'.

Other command line options like -fn and -bg work.  Is the '-T/-title'
option buggy?

I'm running Red Hat 7.2 with:
$ xterm -version
XFree86 4.0.3(156)

$ bash --version
GNU bash, version 2.05.8(1)-release (i386-redhat-linux-gnu)

Thanks for your help.

Regards,
Charles Sullivan



 Wed, 02 Nov 2005 02:24:47 GMT   
 Change xterm title bar?

It's working fine, but Red Hat's default PROMPT_COMMAND for bash includes
escape sequences that tell xterm to change its title to show the current
path. It echos these every time it shows a prompt, so the title you set is
getting overwritten. Unset this variable in your login scripts and your
title will 'stick'.

--
Matthew Miller           mat...@mattdm.org        <http://www.mattdm.org/>
Boston University Linux      ------>                <http://linux.bu.edu/>



 Wed, 02 Nov 2005 02:33:24 GMT   
 Change xterm title bar?

Ahah!  That did it.  Thanks Matthew.



 Wed, 02 Nov 2005 06:36:24 GMT   
 Change xterm title bar?

For those who might be interested in how to change the current xterm's title in
the way Red Hat is doing, consider the following from my .cshrc:

    alias xtermtitle    'echo "%]2;\!*^" | tr %^ "\033\007"'

(I use the "tr" command to avoid inserting control characters as literals in
my script.)

Then you can type something like

    % xtermtitle This is a new title for my XTerm

to change your title on the fly. I don't use this very often, but it's handy
when I want it.



 Mon, 07 Nov 2005 05:36:38 GMT   
 Change xterm title bar?

Hmm... sounds very nice, but it doesn't work in Bash.  I used:
  alias xtermtitle='echo "%]2;\!*^" | tr %^ "\033\007"'

but when I tried
  $ xtermtitle Newtitle
I get:
  tr: too many arguments
  Try `tr --help' for more information.

Any experts out there who know how to translate this to Bash?
I'm afraid it's all Greek to me.



 Mon, 07 Nov 2005 06:52:31 GMT   
 Change xterm title bar?

I use this script:

  #!/bin/sh
  export PROMPT_COMMAND=""
  printf "\033]0;$1\007"

--
Stephen Chadfield
http://www.chadfield.com/



 Mon, 07 Nov 2005 17:06:39 GMT   
 Change xterm title bar?

OK that works after I've unset PROMPT_COMMAND in /etc/bashrc.  Thanks.



 Tue, 08 Nov 2005 06:34:57 GMT   
 
   [ 7 post ] 

Similar Threads

1. How to change xterm title bar string?

2. Dynamically changing xterm title bar in tcsh

3. Changing the title bar for Xterm Windows!!!!

4. Change title bar in xterm?

5. tcsh xterm title bar quoting

6. display the current directory in xterm title bar

7. display pwd in xterm title bar with tcsh

8. HOW to write to xterm title bar from ksh

9. current directory in xterm title-bar


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