diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh index c18aa726c..b0462816b 100644 --- a/plugins/mercurial/mercurial.plugin.zsh +++ b/plugins/mercurial/mercurial.plugin.zsh @@ -39,7 +39,11 @@ $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_SU function hg_dirty_choose { if [ $(in_hg) ]; then - hg status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]' + if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then + hg status -q 2> /dev/null | grep -Eq '^\s*[ACDIMR!L].*$' + else + hg status 2> /dev/null | grep -Eq '^\s*[ACDIMR!?L].*$' + fi if [ $pipestatus[-1] -eq 0 ]; then # Grep exits with 0 when "One or more lines were selected", return "dirty". echo $1