


Almost all window managers (twm, mwm, olwm and their derivates) support
escape sequences for it. For your purpose put following into your
.login (if you're using csh or tcsh), for sh you have to modify it.

if ( "$term" == "xterm" ) then
	echo "^[]2;${LOGNAME}@${HOST}^G^[]1;${HOST}^G"
endif

Note, ^[ stands for <Esc>, in vi you can enter it by pressing
Ctrl-V and the <Esc>. Same for ^G, it means Ctrl-G. In vi:
press Ctrl-V and then Ctrl-G.
The first sequence puts the string into the title bar the second
in the icon.

BTW, you can also put the current working directory in the
title bar if you make an alias for cd:

alias cd 'cd \!* ; echo "^[]2;${LOGNAME}@${HOST}: ${cwd}^G"'

greetings,
Thomas