xttitle home page

A simple utility for changing the title of your xterm windows

Latest Version:  Version 1.0-2, released 04-Dec-2001

  1. Introduction
  2. Example
  3. History
  4. Download
  5. Credits
  6. Contact

04-Dec-2001 Update: I have added a simple man page to the source code, and rebuilt the RPM on a Mandrake 8.1 i686 Linux workstation. The RPM should also work with recent versions of RedHat Linux, but of course your mileage may vary.


1. Introduction

This little bit of code has been in my UNIX tool kit since circa 1994. A friend of mine had a shell script version of this, which I ported to a C program in order to make it faster. Back in the old days, every millisecond counted on those crusty old Sun SPARC 2s!

All this program does is print some escape characters to standard out, which have the magical effect of changing the title of your xterm windows.

Even if you don't need a utility like this, you might wish to peruse the source code to get the escape characters used to change the title bar.

Back to the top.


2. Example

I use this in my "cd" alias in my .tcshrc file like this:

#!/bin/tcsh

set host=`hostname`
set user=`whoami`

switch ( $term )
  case xterm:
    alias cd 'chdir \!*;xttitle $user@$hostname\:$cwd $hostname'
    breaksw
  default:
    echo "Not using xterm settings"
    breaksw
endsw

Whenever I type "cd <dirname>", my xterm window title changes to reflect the current working directory.

Click here for a screenshot of what my xterm windows look like.

Back to the top.


3. History

Back to the top.


4. Download

Latest Version:  Version 1.0-2, released 04-Dec-2001

Back to the top.


5. Credits

Well, I put this together mostly as an experiment to learn to use autoconf/automake and the Redhat Package Manager. The source code isn't that tough. If you find any bugs or have any suggestions, contact me and I'll put your name here if I include your suggestions or fixes in the next release.

Back to the top.


6. Contact

Send any questions, comments, or bugfixes to michael@jarvis.com.

Click here for my page of UNIX links, or here for my main home page.

Back to the top.


Valid HTML 4.01! Hits since 27-Sep-1999:   counter Last modified: 2001/12/04 16:08:40 CST (GMT-0600)