#!/bin/bash # 'ice graphic' prompt PS1="${RESET_CHARSET}" PS1+="${BOLD_CYAN}${MODE_GRAPHIC}" PS1+="${UPPER_LEFT_CORNER}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[ ${BOLD_WHITE}\\t${BOLD_CYAN} ]" PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[ ${BOLD_WHITE}\\d${BOLD_CYAN} ]" PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[${BOLD_WHITE}\\j${BOLD_CYAN}]" PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[${BOLD_WHITE}\#${BOLD_CYAN}]" PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[${BOLD_RED}\${ERR}${BOLD_CYAN}]" # GST_ENV is set before the gst-build subshell starts and is valid until the # subshell exits, so it's OK to only check it once and for all when the prompt # is defined. if [[ -n "${GST_ENV}" ]]; then PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}[ ${BOLD_MAGENTA}${GST_ENV}${BOLD_CYAN} ]" fi # VCSH_DIRECTORY is set before a vcsh subshell starts and is valid until the # subshell exits, so it's OK to only check it once and for all when the prompt # is defined. if [[ -n "${VCSH_DIRECTORY-}" ]]; then PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}[ ${BOLD_YELLOW}VCSH repo: ${BOLD_WHITE}${VCSH_DIRECTORY}${BOLD_CYAN} ]" fi if declare -F __git_ps1 >/dev/null; then # Tell which git branch is currently active. PS1+='$(__git_ps1 ' PS1+="'" PS1+="${MODE_GRAPHIC_QUOTED}${HORIZ_LINE}${MODE_DEFAULT_QUOTED}[ ${BOLD_YELLOW}" PS1+="Git branch: ${BOLD_WHITE}%s" PS1+="${BOLD_CYAN} ]" PS1+="'" PS1+=')' fi PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}\\n" # XXX specifying the color again should not be necessary but bash seems to # forget about the color of the previous prompt line when resizing a terminal # window. PS1+="${BOLD_CYAN}${MODE_GRAPHIC}${LOWER_LEFT_CORNER}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}" PS1+="[ ${BOLD_WHITE}\\u${BOLD_CYAN}${WHITE}@${BOLD_WHITE}\\h${BOLD_CYAN}" PS1+=":${BOLD_WHITE}\\w${BOLD_CYAN} ]${RESET}\\$ "