For completeness current code (haven't fixed the DISPLAY part yet):
if [ -n "$_sh_interactive_shell" ] ; then
shopt -s cdspell checkhash checkwinsize cmdhist dotglob extglob
shopt -s histappend hostcomplete lithist
shopt -s no_empty_cmd_completion xpg_echo
# build a prompt ###########
#specific to linux console compat emulations
_CRed="$(echo -en "\033[31m")"
_CRST="$(echo -en "\033[0m")"
_CBLD="$(echo -en "\033[1m")"
PUBLIC _prompt_open=""
PUBLIC _prompt_close=">"
PUBLIC _disp_port=${DISPLAY/[^:]*:/}
[[ $UID -eq 0 ]] && {
_prompt_open="$_CBLD$_CRed"
_prompt_close="#$_CRST"
}
PS1='${_prompt_open}$(spwd "$PWD")${_prompt_close} ';
if [ -n ${REMOTEHOST:-""} ]; then
#set_icon_and_title
PUB_CONST _pshost=$(echo -en
"\033]1;${USER}@${HOSTNAME}:${_disp_port}\007")
PS1='\[$_pshost\]${_prompt_open}${HOSTNAME}:$(spwd
"$PWD")${_prompt_close} '
fi
PS2='> '
PUBLIC PS1 PS2
########
#setup TTY settings
(My 'PUBLIC's are short for:
alias PUB_CONST="typeset -xr"
alias PUBLIC="typeset -x" ##aka EXPORT