With multiple windows open, it can be confusing which window is which. For example, when using Putty to SSH into a Production Server or a Staging Server... its not obvious at a glance which server is which.
If you insert the following snippet of code into your .bashrc file, it will use a more descriptive prompt (PS1) string in your window header.
Note: The following has been tested under Ubuntu and CentOS operating systems, using Putty clients.
Hint: Use the "view plain" action link in the upper left part of the code segment below, then copy and paste from the "plain text" window.
function wtitle { if [ "$TERM" == "xterm" ] ; then # Remove the old title string in the PS1, if one is already set. PS1=`echo $PS1 | sed -r 's/^\\\\\[.+\\\\\]//g'` export PS1="\[\033]0;$1 - \u@\h:\w\007\]$PS1" fi } wtitle PRODUCTION
Page Views: 1027
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.