How to change the title bar of your xterm

Many users find it convenient to have the current directory displayed in the title bar of their xterm. It is a simple configuration change to make this change permanent.

To set your title:

  1. Use your favorite editor to open your [local] copy of the file named, ~/.cshrc.local


  2. Find and uncomment the following line to set the mytitle alias. To uncomment a line, just delete the # character at the start of the line. To comment out a line, just add the # character at the start of the line or comment.
  3.           alias mytitle 'icon_name; echo -n ^[]1\;$icon_name\^G^[]2\;$HOSTNAME\: $cwd\^G'
    
  4. Find and uncomment the following lines to call the mytitle alias and the prompt and titles to the current directory.
  5.           mytitle
              alias cd 'chdir \!*; mytitle'
              alias cd 'chdir \!*;set prompt="`dirs`#\\!% "; mytitle'
              alias pushd 'pushd \!*; mytitle'
              alias popd 'popd \!*; mytitle'
    

There are many other configuration options available to you within the ~/.cshrc.local file. But do not edit carelessly. You may not be able to login if you "break" this file by introducing a syntax or other more serious error while modifying your shell configuration.