Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > FAQs > How can I tell which window is which?

How can I tell which window is which?

Table of Contents

Background Information

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.

 


Answer

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

You must to post a comment.
Last modified
13:38, 10 Jul 2014

Tags

Classifications

This page has no classifications.

Announcements

None


© 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.