- __mdw_last_rc=$?
- local git rc
- if type __git_ps1 >/dev/null 2>&1; then
- git="$__mdw_prompt_git_left$(__git_ps1)$__mdw_prompt_git_right"
- else
- git=""
- fi
- case $__mdw_last_rc in
- 0) rc="" ;;
- *) rc="$__mdw_prompt_rc_left rc=$__mdw_last_rc$__mdw_prompt_rc_right" ;;
+ case "${TERM-dumb}:${INSIDE_EMACS+$INSIDE_EMACS}" in
+ dumb:)
+ case $(id -u) in 0) PS1='# ' ;; *) PS1='$ ' ;; esac
+ PS2='> '
+ ;;
+ *)
+ __mdw_last_rc=$?
+ local git rc
+ if type __git_ps1 >/dev/null 2>&1; then
+ git="$__mdw_prompt_git_left$(__git_ps1)$__mdw_prompt_git_right"
+ else
+ git=""
+ fi
+ case $__mdw_last_rc in
+ 0) rc="" ;;
+ *) rc="$__mdw_prompt_rc_left rc=$__mdw_last_rc$__mdw_prompt_rc_right" ;;
+ esac
+ PS1="$__mdw_prompt_left$git$rc$__mdw_prompt_right"
+ PS2="$PS1$__mdw_prompt_more"
+ unset __mdw_last_rc
+ ;;