mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-08 04:34:00 +02:00
Merge 29b1272438 into 291e96dcd0
This commit is contained in:
commit
d544fd8be3
1 changed files with 17 additions and 0 deletions
|
|
@ -185,6 +185,22 @@ prompt_hg() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prompt_maildir() {
|
||||||
|
# Avoid zsh complaining for ** not matching anything.
|
||||||
|
unsetopt nomatch 2>/dev/null
|
||||||
|
# Only enable this segment if the $MAILDIR variable is set.
|
||||||
|
if [[ -n "$MAILDIR" ]] then
|
||||||
|
# $MAILDIR should be set to something like "~/Maildir/INBOX/new" for a single maildir, or
|
||||||
|
# "~/Maildir/**/INBOX/new" in case of multiple maildirs in the same folder (if using offlineimap
|
||||||
|
# or similar).
|
||||||
|
eval ls "$MAILDIR/*" >/dev/null 2>&1
|
||||||
|
# ls succeeds if there is at least one file matching the pattern.
|
||||||
|
if [[ $? -eq 0 ]] then
|
||||||
|
prompt_segment black red "M"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
prompt_segment blue black '%~'
|
prompt_segment blue black '%~'
|
||||||
|
|
@ -222,6 +238,7 @@ build_prompt() {
|
||||||
prompt_git
|
prompt_git
|
||||||
prompt_bzr
|
prompt_bzr
|
||||||
prompt_hg
|
prompt_hg
|
||||||
|
prompt_maildir
|
||||||
prompt_end
|
prompt_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue