Truusvlugindewind
Programmer
Linux bash has the env.var PROMPT_COMMAND. You can set is in your .profile e.g:
In your xterm or PuTTy your window title will display "user@hostname:current directory". When you cd to antoher dir the title will be updated.
When you ssh to another linux machine (with PROMP_COMMAND set) you'll see everything updated! Very nice.
When you ssh to a "real" unix/ksh machine.... no go
The linux behavious cannot be accomplished. But a nice bypass in your .profile
.
This will bring "hostname(user)" in the title. Only once. An updated directory cannot be done. But, that's part of our PS1, isitnot?
When you access multiple machines this is a very nice option.
Code:
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
When you ssh to another linux machine (with PROMP_COMMAND set) you'll see everything updated! Very nice.
When you ssh to a "real" unix/ksh machine.... no go
The linux behavious cannot be accomplished. But a nice bypass in your .profile
Code:
echo "\033]0;$(uname -n)($(whoami))\007"
This will bring "hostname(user)" in the title. Only once. An updated directory cannot be done. But, that's part of our PS1, isitnot?
When you access multiple machines this is a very nice option.