#!/usr/local/bin/bash

# ideally we want to use this prompt...
#
# user@host hh:mm:ss cwd
# $ 
# 
# in xterms, we also set the window title to cwd.

# ansi color escape sequences

prompt_black='\[\e[30m\]'
prompt_red='\[\e[31m\]'
prompt_green='\[\e[32m\]'
prompt_yellow='\[\e[33m\]'
prompt_blue='\[\e[34m\]'
prompt_magenta='\[\e[35m\]'
prompt_cyan='\[\e[36m\]'
prompt_white='\[\e[37m\]'
prompt_default_color='\[\e[0m\]'

# pieces of the prompt

prompt_xtitle='\[\e]0;\w\a\]'
prompt_userhost=$prompt_green'\u@\h'
prompt_cwd=$prompt_yellow'\w'
prompt_time=$prompt_magenta'\t'
prompt_go=$prompt_default_color'$ '

# completed prompts

prompt_dos='\n\w>'
prompt_nocolor='\n\u@\h \w\n$ '
prompt_timeless='\n'$prompt_userhost' '$prompt_cwd'\n'$prompt_go
prompt_full='\n'$prompt_userhost' '$prompt_time' '$prompt_cwd'\n'$prompt_go
prompt_xterm="$prompt_xtitle""$prompt_full"

# select prompt based on terminal variable

case $TERM in
  xterm*|rxvt|screen*|cygwin)
    export PS1=$prompt_xterm ;;
  linux*|*vt100*|cons25)
    export PS1=$prompt_full ;;
  *)
    export PS1=$prompt_nocolor ;;
esac