Bash Session Title Bar

 # determine if okay to set colors and termname then does so  # checks copied from default redhat installation /etc/bashrc   # are we an interactive shell?  if [ "$PS1" ]; then      if [ -x /usr/bin/tput ]; then        if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal          stty erase `tput kbs`        fi      fi      case $TERM in        *xterm* | dtterm | *vt100* | *linux* | *cyg* )          [ `uname -s` = "SunOS" ] && TERM=dtterm || TERM=xterm          HOST=`hostname |sed 's/\..*$//g'`          if [ ${HOST} == "unix001" ];                  then BOX="System Test"          fi          PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOST} ${BOX} : ${PWD}\007"'          PS1='\[\e[36;1m\]\u@\[\e[32;1m\]\H:\w# \[\e[0m\]'          if echo hello|grep --color=auto l >/dev/null 2>&1; then            export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'          fi          if ls --help 2>&1 |grep color >/dev/null; then            alias ls='ls -h --color=auto'          fi          ;;        *)          PS1='\u@\h \w\$ '          ;;      esac  fi 

Leave a Reply