#zdep zshrc.d/modules,zshrc.d/options,zshrc.d/vars
### vim:ft=zsh:foldmethod=marker
###
### zsh misc. commands for interactive shells
###
### Frank Terbeck <ft@bewatermyfriend.org>
### Last-Modified: Wed Aug  5 15:41:31 2009
###
### URI: <http://ft.bewatermyfriend.org/comp/zsh.html>
###

### colored filenames with ls
if [[ -x $(which dircolors) ]] ; then
    if [[ ${TERM} == screen* ]] ; then
        eval $( TERM=screen dircolors ${~ZRC_SOURCE_DIR}/dircolors )
    else
        eval $( dircolors ${~ZRC_SOURCE_DIR}/dircolors )
    fi
fi

### umask
umask 0077

### ulimit
# corefile
ulimit -c unlimited

# finally, let's set our prompt
ZNEED_OLD_PROMPT=1
if zis_437 "atleast" ; then
    # whoohoo, new new new. :-)
    function zrcprompt() {
        # Deal with broken versions of promptinit
        setopt localoptions
        local load_prompt=$1

        zis_4310 "atleast" || setopt NO_warn_create_global
        zrcautoload promptinit && promptinit || return 1
        prompt ${load_prompt}
        zrcautoload add-zsh-hook && add-zsh-hook precmd precmd_status
        return 0
    }
    if zrcprompt ft ; then
        ZNEED_OLD_PROMPT=0
    else
        zprintf 0 'FAILED to load prompt theme system!\n'
        zprintf 0 'Falling back to old prompt definition!\n'
    fi
    unfunction zrcprompt
fi

if (( ZNEED_OLD_PROMPT > 0 )) ; then
    # old but backwards compatible; no vcs_info here.
    source ${~ZRC_SOURCE_DIR}/zshrc.d/oldprompt
fi
unset ZNEED_OLD_PROMPT