Datacentre Support Reference Guides

Visit our online shop for ALL your parts, components, laptops, electronics and gadgets
 

XTerm Titles
 

 
 

To update the title bar of an xterm whenever you cd into another directory, enter the following into your ~/.kshrc file:

mcd()
{
   Me=$(whoami)
   Host=$(hostname)
   cd $*
   Pwd=$(pwd)
    echo "<ctrl>-v<ESC>]0;${Me}@${Host}:${Pwd}<ctrl>-v<ctrl>-g\c"
}

alias cd="mcd"

Two minor points: The normal cd<enter> won't work anymore; enter cd ~ This function will lock up dtterms.  It'll log in with hpterms (just won't update the title); however, you'll never see a prompt if you're using dtterms.  Use this function if you want to use Xterms only!