if test -n "$BASH_VERSION"; then
    __shellrc__color_text() {
        printf "$1$2\e[0m"
    }

    __shellrc__show_exit_code() {
        __shellrc__color_text "\e[33m" ${__LAST_CODE__:-0}
    }

    __shellrc__symbol() {
        test $UID -eq 0 && __shellrc__color_text "\e[31m" '#' || __shellrc__color_text "\e[1;33m" '$'
    }

    if [[ $- == *i* ]]; then bind '"\e[A": history-search-backward'; bind '"\e[B": history-search-forward'; fi
    export PS1="\n\[\e[38;5;135m\]\u\[\e[0m\]@\[\e[38;5;166m\]\h\[\e[0m\] \[\e[38;5;118m\]\w\[\e[0m\] {\$(__shellrc__show_exit_code)} \[\e[1;4;33m\]\n$(__shellrc__symbol) "
    export PROMPT_COMMAND='export __LAST_CODE__=$?' RPROMPT=''
elif test -n "$ZSH_VERSION"; then
    __shellrc__color_text() {
        echo $1$2'%f'
    }

    __shellrc__symbol() {
        test $UID -eq 0 && __shellrc__color_text '%F{1}' '#' || __shellrc__color_text '%F{3}' '$'
    }

    bindkey "^[[A" history-beginning-search-backward
    bindkey "^[[B" history-beginning-search-forward
    setopt PROMPT_SUBST
    export PS1=$'%F{135}%n%f@%F{166}%m%f %F{118}%~ %f{%F{3}%?%f}\n%F{3}%U$(__shellrc__symbol)%u '
fi