sabato 8 marzo 2008

System Info in Terminal Window bar

If you work a lot with Terminal to connect to many different remote hosts simultaneusly, then you do need to have info like hostname, username and PWD in the Teminal title bar.

An easy way to get this, if your host system is running "bash", is to issue the following command:
PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"'

This variable sets the command to be issued to the bash before showing the prompt. And the escape sequences are the xterm escape sequences to set the title bar. You can ad whatever you want...

If you can modify the remote user settings, you can add this line in the ".bashrc" file. Otherwise, you work like me on Customer' Systems where it's not so nice to change default properties, you can copy&paste each time you log in.

Marco

Nessun commento: