dots/bash/title_prompt
David Majnemer ba2f3cfb85 huge changes and refactoring done:
-   split zsh into many files
-   add bash support
-   cleaned up lots of stuff, created a commonsh folder for common stuff between bash and zsh
-   commonsh supports an order of execution, deliminated by filename. This is to enforce dependencies
All of these changes were needed so that we could sensibly continue to extend the system
2009-01-02 18:37:27 -05:00

23 lines
552 B
Text
Executable file

function do_prompt ()
{
if [ $? -ne 0 ] ; then
local ERROR_PROMPT="\[\033[01;31m\]"
fi
local BASE
if [ $UID -ne 0 ] ; then
BASE="$"
else
BASE="#"
fi
export PS1="\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
echo -ne "\033]0;${USER}@${HOSTNAME}\007"
}
PROMPT_COMMAND=do_prompt
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
trap 'echo -e "\e]1;${USER}@${HOSTNAME}: $BASH_COMMAND\007\c"' DEBUG