From d7622624aaddab6ee34c66efba4f83860a6fa622 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Sat, 17 Feb 2018 08:06:34 -0800
Subject: [PATCH 01/21] autosuggestions: add basic history troubleshooting
 information

---
 modules/autosuggestions/README.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/autosuggestions/README.md b/modules/autosuggestions/README.md
index ad0f7ece..c3e90a49 100644
--- a/modules/autosuggestions/README.md
+++ b/modules/autosuggestions/README.md
@@ -46,6 +46,14 @@ To set the query found color, add the following line to *zpreztorc*:
 zstyle ':prezto:module:autosuggestions:color' found ''
 ```
 
+Troubleshooting
+---------------
+
+### Autosuggestions from previous sessions don't show up
+
+For autosuggestions from previous shell sessions to work, please make sure you
+also have the `history` module enabled.
+
 Authors
 -------
 

From e26387656d833ae7321c06415a65118af08b6d89 Mon Sep 17 00:00:00 2001
From: Alexey Zapparov <ixti@member.fsf.org>
Date: Mon, 12 Feb 2018 04:28:51 +0100
Subject: [PATCH 02/21] Don't double-source chruby

If chruby was installed using default way, most likely chruby and
auto-switching will be already sourced (at least on most Linuxes).
---
 modules/ruby/init.zsh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh
index 3f666c3e..4ede3667 100644
--- a/modules/ruby/init.zsh
+++ b/modules/ruby/init.zsh
@@ -25,9 +25,14 @@ elif (( $+commands[rbenv] )); then
 
 # Load package manager installed chruby into the shell session.
 elif (( $+commands[chruby-exec] )); then
-  source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
+  if (( ! $+functions[chruby] )); then
+    source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
+  fi
+
   if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then
-    source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
+    if (( ! $+functions[chruby_auto] )); then
+      source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
+    fi
 
     # If a default Ruby is set, switch to it.
     chruby_auto

From 6d00fdf8c8e4003a89d622590265d80356a7a95f Mon Sep 17 00:00:00 2001
From: "John P. Neumann" <johnpneumann@users.noreply.github.com>
Date: Tue, 20 Feb 2018 22:36:29 -0600
Subject: [PATCH 03/21] Only call reset-prompt when the appropriate zstyle is
 set

Resolves issue #1524 (#1548)
---
 modules/editor/README.md                     |  2 ++
 modules/editor/init.zsh                      | 15 ++++++++-------
 modules/prompt/functions/prompt_smiley_setup |  2 +-
 runcoms/zpreztorc                            |  3 ---
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/modules/editor/README.md b/modules/editor/README.md
index c27e8642..f0799611 100644
--- a/modules/editor/README.md
+++ b/modules/editor/README.md
@@ -26,6 +26,8 @@ zstyle ':prezto:module:editor' dot-expansion 'yes'
 
 ### PS Context
 
+**NOTE:** *This is deprecated and will be removed in future versions.*
+
 To enable the prompt context to be set, add the following to your
 *zpreztorc*.
 
diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh
index 085947ef..df019e76 100644
--- a/modules/editor/init.zsh
+++ b/modules/editor/init.zsh
@@ -116,20 +116,21 @@ function editor-info {
 }
 zle -N editor-info
 
-# Reset the prompt based on the current context and
-# the ps-context option.
+# Reset the prompt based on the current context and whether the prompt utilizes
+# the editor:info zstyle. If the prompt does utilize the editor:info, we must
+# reset the prompt, otherwise the change in the prompt will never update. If the
+# prompt does not utilize the editor:info, we simply redisplay the command line.
 function zle-reset-prompt {
-  if zstyle -t ':prezto:module:editor' ps-context; then
+  # Explicitly check to see if there is an editor info keymap set that would
+  # require a reset of the prompt
+  if zstyle -L ':prezto:module:editor:info*' | grep -v 'completing' > /dev/null 2>&1; then
     # If we aren't within one of the specified contexts, then we want to reset
     # the prompt with the appropriate editor_info[keymap] if there is one.
     if [[ $CONTEXT != (select|cont) ]]; then
       zle reset-prompt
-      zle -R
     fi
-  else
-    zle reset-prompt
-    zle -R
   fi
+  zle -R
 }
 zle -N zle-reset-prompt
 
diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup
index 3066a2dc..3d41b3af 100644
--- a/modules/prompt/functions/prompt_smiley_setup
+++ b/modules/prompt/functions/prompt_smiley_setup
@@ -36,7 +36,7 @@ function prompt_smiley_precmd {
 
 function prompt_smiley_setup {
   unsetopt XTRACE KSH_ARRAYS
-  prompt_opts=(percent subst)
+  prompt_opts=(cr percent sp subst)
 
   # Add hook for calling git-info before each command.
   add-zsh-hook precmd prompt_smiley_precmd
diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc
index c1091555..d2a15729 100644
--- a/runcoms/zpreztorc
+++ b/runcoms/zpreztorc
@@ -62,9 +62,6 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
 # Auto convert .... to ../..
 # zstyle ':prezto:module:editor' dot-expansion 'yes'
 
-# Allow the zsh prompt context to be shown.
-#zstyle ':prezto:module:editor' ps-context 'yes'
-
 #
 # Git
 #

From 4325f74f9dfc83d01409c78fd126a5d29f0a3a55 Mon Sep 17 00:00:00 2001
From: Rick Jones <rickjones@Rick-Jones.local>
Date: Tue, 8 Mar 2016 16:00:29 +0000
Subject: [PATCH 04/21] git: add tag aliases

Originally submitted in https://github.com/sorin-ionescu/prezto/pull/1094
---
 modules/git/README.md | 5 +++++
 modules/git/alias.zsh | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/modules/git/README.md b/modules/git/README.md
index bd67f712..6bc8429e 100644
--- a/modules/git/README.md
+++ b/modules/git/README.md
@@ -288,6 +288,11 @@ zstyle ':prezto:module:git:alias' skip 'yes'
   - `gSu` fetches and merges the latest changes for all submodule.
   - `gSx` removes a submodule.
 
+### Tag
+
+  - `gt` lists tags or creates tag.
+  - `gtl` lists tags matching pattern.
+
 ### Working directory
 
   - `gws` displays working-tree status in the short format.
diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh
index 4a5789fe..a54a2e08 100644
--- a/modules/git/alias.zsh
+++ b/modules/git/alias.zsh
@@ -250,6 +250,10 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
   alias gSu='git submodule foreach git pull origin master'
   alias gSx='git-submodule-remove'
 
+  # Tag (t)
+  alias gt='git tag'
+  alias gtl='git tag -l'
+
   # Working Copy (w)
   alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'
   alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}'

From 580ddc44f3c567202670f62047cc1edb2e0d09ab Mon Sep 17 00:00:00 2001
From: Philipp A <flying-sheep@web.de>
Date: Fri, 25 Sep 2015 12:38:12 +0200
Subject: [PATCH 05/21] Add another shadow to the git aliases

Originally submitted in https://github.com/sorin-ionescu/prezto/pull/979
---
 modules/git/README.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/git/README.md b/modules/git/README.md
index 6bc8429e..1eba33cb 100644
--- a/modules/git/README.md
+++ b/modules/git/README.md
@@ -312,9 +312,10 @@ zstyle ':prezto:module:git:alias' skip 'yes'
 
 The following aliases may shadow system commands:
 
-  - `gpt` shadows the [GUID partition table maintenance utility][4].
-  - `gs` shadows the [Ghostscript][5].
   - `gb` shadows the [GB][9].
+  - `gm` shadows the [Graphics Magick image processor][11].
+  - `gpt` shadows the [GUID partition table maintenance utility][4].
+  - `gs` shadows the [Ghostscript interpreter and previewer][5].
 
 If you frequently use the above commands, you may wish to remove said aliases
 from this module or to disable them at the bottom of the zshrc with `unalias`.
@@ -439,9 +440,10 @@ Authors
 [2]: https://github.com/defunkt/hub
 [3]: https://www.github.com
 [4]: http://www.manpagez.com/man/8/gpt/
-[5]: http://linux.die.net/man/1/gs
+[5]: http://www.manpagez.com/man/1/gs/
 [6]: https://github.com/sorin-ionescu/prezto/issues
 [7]: https://github.com/sorin-ionescu/prezto/issues/219
 [8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
 [9]: https://getgb.io/
 [10]: https://github.com/blog/985-git-io-github-url-shortener
+[11]: http://www.manpagez.com/man/1/gm/

From 742260b55f3071352776e51d8e83544db62a37a9 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Wed, 21 Feb 2018 14:10:11 -0800
Subject: [PATCH 06/21] Remove support for pydf to make options more consistent

Closes #1388
---
 modules/utility/init.zsh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh
index 1ccf13b7..c6c87d2a 100644
--- a/modules/utility/init.zsh
+++ b/modules/utility/init.zsh
@@ -151,12 +151,7 @@ elif (( $+commands[wget] )); then
 fi
 
 # Resource Usage
-if (( $+commands[pydf] )); then
-  alias df=pydf
-else
-  alias df='df -kh'
-fi
-
+alias df='df -kh'
 alias du='du -kh'
 
 if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then

From e00562e7cf20c48a255212a088ab134ea0c6a543 Mon Sep 17 00:00:00 2001
From: bryndin <bryndin@gmail.com>
Date: Fri, 23 Feb 2018 13:39:45 -0800
Subject: [PATCH 07/21] python: autoload add-zsh-hook when needed (#1549)

Fixes #1550
---
 modules/python/init.zsh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/python/init.zsh b/modules/python/init.zsh
index 94eeab79..bb48f6cd 100644
--- a/modules/python/init.zsh
+++ b/modules/python/init.zsh
@@ -82,6 +82,7 @@ function _python-workon-cwd {
 # Load auto workon cwd hook
 if zstyle -t ':prezto:module:python:virtualenv' auto-switch 'yes'; then
   # Auto workon when changing directory
+  autoload -Uz add-zsh-hook
   add-zsh-hook chpwd _python-workon-cwd
 fi
 

From b3c27bb16460c677eabbe3d8e210f79fb5e8189b Mon Sep 17 00:00:00 2001
From: Diego Rabatone Oliveira <diraol@diraol.eng.br>
Date: Mon, 5 Mar 2018 05:56:25 -0300
Subject: [PATCH 08/21] Replace git with 'command git' (#1551)

to improve performance if git is aliased to hub or other wrappers.
---
 modules/git/functions/_git-hub-browse         |  8 +++---
 modules/git/functions/_git-info               |  2 +-
 modules/git/functions/_git-submodule-move     |  4 +--
 modules/git/functions/_git-submodule-remove   |  4 +--
 modules/git/functions/git-branch-current      |  4 +--
 modules/git/functions/git-commit-lost         |  6 ++--
 modules/git/functions/git-dir                 |  2 +-
 modules/git/functions/git-hub-browse          | 10 +++----
 modules/git/functions/git-info                | 28 +++++++++----------
 modules/git/functions/git-root                |  2 +-
 .../git/functions/git-stash-clear-interactive |  6 ++--
 modules/git/functions/git-stash-dropped       |  6 ++--
 modules/git/functions/git-stash-recover       |  6 ++--
 modules/git/functions/git-submodule-move      |  6 ++--
 modules/git/functions/git-submodule-remove    | 12 ++++----
 modules/utility/functions/wdiff               |  2 +-
 16 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/modules/git/functions/_git-hub-browse b/modules/git/functions/_git-hub-browse
index 9e6d6f0d..075314bb 100644
--- a/modules/git/functions/_git-hub-browse
+++ b/modules/git/functions/_git-hub-browse
@@ -8,7 +8,7 @@
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
 #
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   return 1
 fi
 
@@ -21,7 +21,7 @@ _arguments -C -s -S \
 
 case "$state" in
   (remote)
-    remotes=($(git config --get-regexp 'remote.*.url' | cut -d. -f2))
+    remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2))
 
     _describe -t branch 'remotes' remotes && ret=0
   ;;
@@ -29,7 +29,7 @@ case "$state" in
     remote="$words[(($CURRENT - 1))]"
 
     branches_or_tags=($(
-      git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2
+      command git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2
     ))
 
     branches=(HEAD ${${(M)branches_or_tags[@]##refs/heads/?##}##refs/heads/})
@@ -39,7 +39,7 @@ case "$state" in
     _describe -t tag 'tags' tags && ret=0
   ;;
   (file)
-    files=(${(0)"$(_call_program files git ls-files -z --exclude-standard 2> /dev/null)"})
+    files=(${(0)"$(_call_program files command git ls-files -z --exclude-standard 2> /dev/null)"})
     _wanted file expl 'file' _multi_parts - / files && ret=0
   ;;
 esac
diff --git a/modules/git/functions/_git-info b/modules/git/functions/_git-info
index 1e21bfeb..ef6d9702 100644
--- a/modules/git/functions/_git-info
+++ b/modules/git/functions/_git-info
@@ -8,7 +8,7 @@
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
 #
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   return 1
 fi
 
diff --git a/modules/git/functions/_git-submodule-move b/modules/git/functions/_git-submodule-move
index 44eddb54..5f2122c4 100644
--- a/modules/git/functions/_git-submodule-move
+++ b/modules/git/functions/_git-submodule-move
@@ -8,7 +8,7 @@
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
 #
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   return 1
 fi
 
@@ -25,7 +25,7 @@ case "$state" in
     while IFS=$'\n' read submodule; do
       submodules+=("$submodule")
     done < <(
-      git config --file "$(git-root)/.gitmodules" --list \
+      command git config --file "$(git-root)/.gitmodules" --list \
         | grep '.path=' \
         | cut -d= -f2-
     )
diff --git a/modules/git/functions/_git-submodule-remove b/modules/git/functions/_git-submodule-remove
index 87bd7cb0..819dfd8e 100644
--- a/modules/git/functions/_git-submodule-remove
+++ b/modules/git/functions/_git-submodule-remove
@@ -8,7 +8,7 @@
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
 #
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   return 1
 fi
 
@@ -18,7 +18,7 @@ local submodule
 while IFS=$'\n' read submodule; do
   submodules+=("$submodule")
 done < <(
-  git config --file "$(git-root)/.gitmodules" --list \
+  command git config --file "$(git-root)/.gitmodules" --list \
     | grep '.path=' \
     | cut -d= -f2-
 )
diff --git a/modules/git/functions/git-branch-current b/modules/git/functions/git-branch-current
index cadb6f63..3cf2e191 100644
--- a/modules/git/functions/git-branch-current
+++ b/modules/git/functions/git-branch-current
@@ -7,12 +7,12 @@
 
 # function git-branch-current {
 
-if ! git rev-parse 2> /dev/null; then
+if ! command git rev-parse 2> /dev/null; then
   print "$0: not a repository: $PWD" >&2
   return 1
 fi
 
-local ref="$(git symbolic-ref HEAD 2> /dev/null)"
+local ref="$(command git symbolic-ref HEAD 2> /dev/null)"
 
 if [[ -n "$ref" ]]; then
   print "${ref#refs/heads/}"
diff --git a/modules/git/functions/git-commit-lost b/modules/git/functions/git-commit-lost
index 62789ac9..1f086d3b 100644
--- a/modules/git/functions/git-commit-lost
+++ b/modules/git/functions/git-commit-lost
@@ -7,15 +7,15 @@
 
 # function git-commit-lost {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 fi
 
-git fsck 2> /dev/null \
+command git fsck 2> /dev/null \
   | grep "^dangling commit" \
   | awk '{print $3}' \
-  | git log \
+  | command git log \
       --date-order \
       --no-walk \
       --stdin \
diff --git a/modules/git/functions/git-dir b/modules/git/functions/git-dir
index fdb515c5..aacaaa88 100644
--- a/modules/git/functions/git-dir
+++ b/modules/git/functions/git-dir
@@ -7,7 +7,7 @@
 
 # function git-dir {
 
-local git_dir="${$(git rev-parse --git-dir):A}"
+local git_dir="${$(command git rev-parse --git-dir):A}"
 
 if [[ -n "$git_dir" ]]; then
   print "$git_dir"
diff --git a/modules/git/functions/git-hub-browse b/modules/git/functions/git-hub-browse
index a365a5a9..cb3fc60d 100644
--- a/modules/git/functions/git-hub-browse
+++ b/modules/git/functions/git-hub-browse
@@ -7,7 +7,7 @@
 
 # function git-hub-browse {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 fi
@@ -15,7 +15,7 @@ fi
 local remotes remote references reference file url
 
 remote="${1:-origin}"
-remotes=($(git config --get-regexp 'remote.*.url' | cut -d. -f2))
+remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2))
 
 if (( $remotes[(i)$remote] == $#remotes + 1 )); then
   print "$0: remote not found: $remote" >&2
@@ -23,14 +23,14 @@ if (( $remotes[(i)$remote] == $#remotes + 1 )); then
 fi
 
 url=$(
-  git config --get "remote.${remote}.url" \
+  command git config --get "remote.${remote}.url" \
     | sed -En "s/(git|https?)(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\4\/\5/p"
 )
 
 reference="${${2:-$(git-branch-current)}:-HEAD}"
 references=(
   HEAD
-  ${$(git ls-remote --heads --tags "$remote" | awk '{print $2}')##refs/(heads|tags)/}
+  ${$(command git ls-remote --heads --tags "$remote" | awk '{print $2}')##refs/(heads|tags)/}
 )
 
 if (( $references[(i)$reference] == $#references + 1 )); then
@@ -39,7 +39,7 @@ if (( $references[(i)$reference] == $#references + 1 )); then
 fi
 
 if [[ "$reference" == 'HEAD' ]]; then
-  reference="$(git rev-parse HEAD 2> /dev/null)"
+  reference="$(command git rev-parse HEAD 2> /dev/null)"
 fi
 
 file="$3"
diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info
index d27365c2..a173c20f 100644
--- a/modules/git/functions/git-info
+++ b/modules/git/functions/git-info
@@ -178,15 +178,15 @@ function git-info {
   typeset -gA git_info
 
   # Return if not inside a Git repository work tree.
-  if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+  if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
     return 1
   fi
 
   if (( $# > 0 )); then
     if [[ "$1" == [Oo][Nn] ]]; then
-      git config --bool prompt.showinfo true
+      command git config --bool prompt.showinfo true
     elif [[ "$1" == [Oo][Ff][Ff] ]]; then
-      git config --bool prompt.showinfo false
+      command git config --bool prompt.showinfo false
     else
       print "usage: $0 [ on | off ]" >&2
     fi
@@ -194,7 +194,7 @@ function git-info {
   fi
 
   # Return if git-info is disabled.
-  if ! is-true "${$(git config --bool prompt.showinfo):-true}"; then
+  if ! is-true "${$(command git config --bool prompt.showinfo):-true}"; then
     return 1
   fi
 
@@ -204,7 +204,7 @@ function git-info {
   # Format commit.
   zstyle -s ':prezto:module:git:info:commit' format 'commit_format'
   if [[ -n "$commit_format" ]]; then
-    commit="$(git rev-parse HEAD 2> /dev/null)"
+    commit="$(command git rev-parse HEAD 2> /dev/null)"
     if [[ -n "$commit" ]]; then
       zformat -f commit_formatted "$commit_format" "c:$commit"
     fi
@@ -213,7 +213,7 @@ function git-info {
   # Format stashed.
   zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format'
   if [[ -n "$stashed_format" && -f "$(git-dir)/refs/stash" ]]; then
-    stashed="$(git stash list 2> /dev/null | wc -l | awk '{print $1}')"
+    stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
     if [[ -n "$stashed" ]]; then
       zformat -f stashed_formatted "$stashed_format" "S:$stashed"
     fi
@@ -229,7 +229,7 @@ function git-info {
   fi
 
   # Get the branch.
-  branch="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
+  branch="${$(command git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
 
   # Format branch.
   zstyle -s ':prezto:module:git:info:branch' format 'branch_format'
@@ -240,7 +240,7 @@ function git-info {
   # Format position.
   zstyle -s ':prezto:module:git:info:position' format 'position_format'
   if [[ -z "$branch" && -n "$position_format" ]]; then
-    position="$(git describe --contains --all HEAD 2> /dev/null)"
+    position="$(command git describe --contains --all HEAD 2> /dev/null)"
     if [[ -n "$position" ]]; then
       zformat -f position_formatted "$position_format" "p:$position"
     fi
@@ -250,7 +250,7 @@ function git-info {
   zstyle -s ':prezto:module:git:info:remote' format 'remote_format'
   if [[ -n "$branch" && -n "$remote_format" ]]; then
     # Gets the remote name.
-    remote_cmd='git rev-parse --symbolic-full-name --verify HEAD@{upstream}'
+    remote_cmd='command git rev-parse --symbolic-full-name --verify HEAD@{upstream}'
     remote="${$(${(z)remote_cmd} 2> /dev/null)##refs/remotes/}"
     if [[ -n "$remote" ]]; then
       zformat -f remote_formatted "$remote_format" "R:$remote"
@@ -261,7 +261,7 @@ function git-info {
   zstyle -s ':prezto:module:git:info:behind' format 'behind_format'
   if [[ -n "$branch" && ( -n "$ahead_format" || -n "$behind_format" ) ]]; then
     # Gets the commit difference counts between local and remote.
-    ahead_and_behind_cmd='git rev-list --count --left-right HEAD...@{upstream}'
+    ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}'
 
     # Get ahead and behind counts.
     ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)"
@@ -290,7 +290,7 @@ function git-info {
     if [[ -n "$indexed_format" ]]; then
       ((
         indexed+=$(
-          git diff-index \
+          command git diff-index \
             --no-ext-diff \
             --name-only \
             --cached \
@@ -310,7 +310,7 @@ function git-info {
     if [[ -n "$unindexed_format" ]]; then
       ((
         unindexed+=$(
-          git diff-files \
+          command git diff-files \
             --no-ext-diff \
             --name-only \
             --ignore-submodules=${ignore_submodules:-none} \
@@ -328,7 +328,7 @@ function git-info {
     if [[ -n "$untracked_format" ]]; then
       ((
         untracked+=$(
-          git ls-files \
+          command git ls-files \
             --other \
             --exclude-standard \
             2> /dev/null \
@@ -343,7 +343,7 @@ function git-info {
     (( dirty = indexed + unindexed + untracked ))
   else
     # Use porcelain status for easy parsing.
-    status_cmd="git status --porcelain --ignore-submodules=${ignore_submodules:-none}"
+    status_cmd="command git status --porcelain --ignore-submodules=${ignore_submodules:-none}"
 
     # Get current status.
     while IFS=$'\n' read line; do
diff --git a/modules/git/functions/git-root b/modules/git/functions/git-root
index f7494572..643f346b 100644
--- a/modules/git/functions/git-root
+++ b/modules/git/functions/git-root
@@ -7,7 +7,7 @@
 
 # function git-root {
 
-local root="$(git rev-parse --show-toplevel 2> /dev/null)"
+local root="$(command git rev-parse --show-toplevel 2> /dev/null)"
 
 if [[ -n "$root" ]]; then
   print "$root"
diff --git a/modules/git/functions/git-stash-clear-interactive b/modules/git/functions/git-stash-clear-interactive
index 71468aa0..cc665a18 100644
--- a/modules/git/functions/git-stash-clear-interactive
+++ b/modules/git/functions/git-stash-clear-interactive
@@ -7,7 +7,7 @@
 
 # function git-stash-clear-interactive {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 fi
@@ -15,10 +15,10 @@ fi
 local stashed
 
 if [[ -f "$(git-dir)/refs/stash" ]]; then
-  stashed="$(git stash list 2> /dev/null | wc -l | awk '{print $1}')"
+  stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
   if (( $stashed > 0 )); then
     if read -q "?Clear $stashed stashed state(s) [y/N]? "; then
-      git stash clear
+      command git stash clear
     fi
   fi
 fi
diff --git a/modules/git/functions/git-stash-dropped b/modules/git/functions/git-stash-dropped
index 2a0b7a94..d9e759e8 100644
--- a/modules/git/functions/git-stash-dropped
+++ b/modules/git/functions/git-stash-dropped
@@ -7,15 +7,15 @@
 
 # function git-stash-dropped {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 fi
 
-git fsck --unreachable 2> /dev/null \
+command git fsck --unreachable 2> /dev/null \
   | grep 'commit' \
   | awk '{print $3}' \
-  | git log \
+  | command git log \
       --pretty=format:${_git_log_oneline_format} \
       --extended-regexp \
       --grep="${1:-(WIP )?[Oo]n [^:]+:}" \
diff --git a/modules/git/functions/git-stash-recover b/modules/git/functions/git-stash-recover
index 5cc949a7..6cb5416e 100644
--- a/modules/git/functions/git-stash-recover
+++ b/modules/git/functions/git-stash-recover
@@ -7,7 +7,7 @@
 
 # function git-stash-recover {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 fi
@@ -15,8 +15,8 @@ fi
 local commit
 
 for commit in "$@"; do
-  git update-ref \
-    -m "$(git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit"
+  command git update-ref \
+    -m "$(command git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit"
 done
 
 # }
diff --git a/modules/git/functions/git-submodule-move b/modules/git/functions/git-submodule-move
index ec6048e6..746f46e5 100644
--- a/modules/git/functions/git-submodule-move
+++ b/modules/git/functions/git-submodule-move
@@ -7,7 +7,7 @@
 
 # function git-submodule-move {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 elif [[ "$PWD" != "$(git-root)" ]]; then
@@ -19,7 +19,7 @@ local src="$1"
 local dst="$2"
 local url
 
-url="$(git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
+url="$(command git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
 
 if [[ -z "$url" ]]; then
   print "$0: submodule not found: $src" >&2
@@ -29,7 +29,7 @@ fi
 mkdir -p "${dst:h}"
 
 git-submodule-remove "$src"
-git submodule add "$url" "$dst"
+command git submodule add "$url" "$dst"
 
 return 0
 
diff --git a/modules/git/functions/git-submodule-remove b/modules/git/functions/git-submodule-remove
index 2490e78c..c8c11aa8 100644
--- a/modules/git/functions/git-submodule-remove
+++ b/modules/git/functions/git-submodule-remove
@@ -7,22 +7,22 @@
 
 # function git-submodule-remove {
 
-if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
+if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
   print "$0: not a repository work tree: $PWD" >&2
   return 1
 elif [[ "$PWD" != "$(git-root)" ]]; then
   print "$0: must be run from the root of the work tree" >&2
   return 1
-elif ! git config --file .gitmodules --get "submodule.${1}.path" &>/dev/null; then
+elif ! command git config --file .gitmodules --get "submodule.${1}.path" &> /dev/null; then
   print "$0: submodule not found: $1" >&2
   return 1
 fi
 
-git config --file "$(git-dir)/config" --remove-section "submodule.${1}" &>/dev/null
-git config --file "$(git-root)/.gitmodules" --remove-section "submodule.${1}" &>/dev/null
-git add .gitmodules
+command git config --file "$(git-dir)/config" --remove-section "submodule.${1}" &> /dev/null
+command git config --file "$(git-root)/.gitmodules" --remove-section "submodule.${1}" &> /dev/null
+command git add .gitmodules
 
-git rm --cached -rf "${1}"
+command git rm --cached -rf "${1}"
 rm -rf "${1}"
 rm -rf "$(git-dir)/modules/${1}"
 
diff --git a/modules/utility/functions/wdiff b/modules/utility/functions/wdiff
index c93ead1c..ebfad0b8 100644
--- a/modules/utility/functions/wdiff
+++ b/modules/utility/functions/wdiff
@@ -17,7 +17,7 @@ function wdiff {
         "$@" \
       | sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g'
     elif (( $+commands[git] )); then
-      git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
+      command git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
     else
       command wdiff "$@"
     fi

From a0977cb92e0e4a8483bd256a472119451cf3e933 Mon Sep 17 00:00:00 2001
From: Roman Peshkov <peshkovroman@gmail.com>
Date: Sat, 31 Mar 2018 02:37:05 +0200
Subject: [PATCH 09/21] Ignore tmux autostart in vscode terminal

---
 modules/tmux/init.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh
index a361a6a6..fb56d076 100644
--- a/modules/tmux/init.zsh
+++ b/modules/tmux/init.zsh
@@ -23,7 +23,7 @@ if ([[ "$TERM_PROGRAM" = 'iTerm.app' ]] && \
   _tmux_iterm_integration='-CC'
 fi
 
-if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" ]] && ( \
+if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_PID" ]] && ( \
   ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
   ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
 ); then

From 443021237a38e04522bb76f77c3f146d64edba29 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Fri, 30 Mar 2018 17:47:05 -0700
Subject: [PATCH 10/21] Allow users to easily define LS_COLORS and LSCOLORS
 (#1546)

---
 modules/utility/init.zsh | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh
index c6c87d2a..7f75fb83 100644
--- a/modules/utility/init.zsh
+++ b/modules/utility/init.zsh
@@ -76,10 +76,13 @@ if is-callable 'dircolors'; then
   alias ls='ls --group-directories-first'
 
   if zstyle -t ':prezto:module:utility:ls' color; then
-    if [[ -s "$HOME/.dir_colors" ]]; then
-      eval "$(dircolors --sh "$HOME/.dir_colors")"
-    else
-      eval "$(dircolors --sh)"
+    # Call dircolors to define colors if they're missing
+    if [[ -z "$LS_COLORS" ]]; then
+      if [[ -s "$HOME/.dir_colors" ]]; then
+        eval "$(dircolors --sh "$HOME/.dir_colors")"
+      else
+        eval "$(dircolors --sh)"
+      fi
     fi
 
     alias ls="${aliases[ls]:-ls} --color=auto"
@@ -89,11 +92,15 @@ if is-callable 'dircolors'; then
 else
   # BSD Core Utilities
   if zstyle -t ':prezto:module:utility:ls' color; then
-    # Define colors for BSD ls.
-    export LSCOLORS='exfxcxdxbxGxDxabagacad'
+    # Define colors for BSD ls if they're not already defined
+    if [[ -z "$LSCOLORS" ]]; then
+      export LSCOLORS='exfxcxdxbxGxDxabagacad'
+    fi
 
-    # Define colors for the completion system.
-    export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
+    # Define colors for the completion system if they're not already defined
+    if [[ -z "$LS_COLORS" ]]; then
+      export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
+    fi
 
     alias ls="${aliases[ls]:-ls} -G"
   else

From 1b441e7654b6b1c8e766d68d548abd7e5597604e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20VANTOMME?= <akarzim@gmail.com>
Date: Thu, 5 Apr 2018 00:20:21 +0200
Subject: [PATCH 11/21] Feat (git): add an alias displaying the commits yet to
 be applied to upstream (#1565)

---
 modules/git/README.md | 2 ++
 modules/git/alias.zsh | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/modules/git/README.md b/modules/git/README.md
index 1eba33cb..1d4b7ba5 100644
--- a/modules/git/README.md
+++ b/modules/git/README.md
@@ -82,6 +82,8 @@ zstyle ':prezto:module:git:alias' skip 'yes'
   - `gcR` removes the *HEAD* commit.
   - `gcs` displays various types of objects.
   - `gcl` lists lost commits.
+  - `gcy` displays commits yet to be applied to upstream in the short format.
+  - `gcY` displays commits yet to be applied to upstream.
 
 ### Conflict
 
diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh
index a54a2e08..dde5b351 100644
--- a/modules/git/alias.zsh
+++ b/modules/git/alias.zsh
@@ -69,6 +69,8 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
   alias gcR='git reset "HEAD^"'
   alias gcs='git show'
   alias gcl='git-commit-lost'
+  alias gcy='git cherry -v --abbrev'
+  alias gcY='git cherry -v'
 
   # Conflict (C)
   alias gCl='git --no-pager diff --name-only --diff-filter=U'

From 054eb351f1d7d92d810259e3a5fbfd9e025b2d08 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Fri, 6 Apr 2018 11:33:02 -0700
Subject: [PATCH 12/21] Revert "Only call reset-prompt when the appropriate
 zstyle is set"

This reverts commit 6d00fdf8c8e4003a89d622590265d80356a7a95f.

As unfortunate as it is, this workaround was a hack and doesn't take
into account prompts like spaceship which don't use $editor_info but
rely on $KEYMAP directly. We'll need to find a more consistent solution
to fix this.
---
 modules/editor/README.md                     |  2 --
 modules/editor/init.zsh                      | 15 +++++++--------
 modules/prompt/functions/prompt_smiley_setup |  2 +-
 runcoms/zpreztorc                            |  3 +++
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/modules/editor/README.md b/modules/editor/README.md
index f0799611..c27e8642 100644
--- a/modules/editor/README.md
+++ b/modules/editor/README.md
@@ -26,8 +26,6 @@ zstyle ':prezto:module:editor' dot-expansion 'yes'
 
 ### PS Context
 
-**NOTE:** *This is deprecated and will be removed in future versions.*
-
 To enable the prompt context to be set, add the following to your
 *zpreztorc*.
 
diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh
index df019e76..085947ef 100644
--- a/modules/editor/init.zsh
+++ b/modules/editor/init.zsh
@@ -116,21 +116,20 @@ function editor-info {
 }
 zle -N editor-info
 
-# Reset the prompt based on the current context and whether the prompt utilizes
-# the editor:info zstyle. If the prompt does utilize the editor:info, we must
-# reset the prompt, otherwise the change in the prompt will never update. If the
-# prompt does not utilize the editor:info, we simply redisplay the command line.
+# Reset the prompt based on the current context and
+# the ps-context option.
 function zle-reset-prompt {
-  # Explicitly check to see if there is an editor info keymap set that would
-  # require a reset of the prompt
-  if zstyle -L ':prezto:module:editor:info*' | grep -v 'completing' > /dev/null 2>&1; then
+  if zstyle -t ':prezto:module:editor' ps-context; then
     # If we aren't within one of the specified contexts, then we want to reset
     # the prompt with the appropriate editor_info[keymap] if there is one.
     if [[ $CONTEXT != (select|cont) ]]; then
       zle reset-prompt
+      zle -R
     fi
+  else
+    zle reset-prompt
+    zle -R
   fi
-  zle -R
 }
 zle -N zle-reset-prompt
 
diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup
index 3d41b3af..3066a2dc 100644
--- a/modules/prompt/functions/prompt_smiley_setup
+++ b/modules/prompt/functions/prompt_smiley_setup
@@ -36,7 +36,7 @@ function prompt_smiley_precmd {
 
 function prompt_smiley_setup {
   unsetopt XTRACE KSH_ARRAYS
-  prompt_opts=(cr percent sp subst)
+  prompt_opts=(percent subst)
 
   # Add hook for calling git-info before each command.
   add-zsh-hook precmd prompt_smiley_precmd
diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc
index d2a15729..c1091555 100644
--- a/runcoms/zpreztorc
+++ b/runcoms/zpreztorc
@@ -62,6 +62,9 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
 # Auto convert .... to ../..
 # zstyle ':prezto:module:editor' dot-expansion 'yes'
 
+# Allow the zsh prompt context to be shown.
+#zstyle ':prezto:module:editor' ps-context 'yes'
+
 #
 # Git
 #

From 300102897a4710e1559e4435c686f794d126d3c3 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Fri, 6 Apr 2018 11:35:39 -0700
Subject: [PATCH 13/21] Add proper prompt_opts to smiley prompt

---
 modules/prompt/functions/prompt_smiley_setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup
index 3066a2dc..3d41b3af 100644
--- a/modules/prompt/functions/prompt_smiley_setup
+++ b/modules/prompt/functions/prompt_smiley_setup
@@ -36,7 +36,7 @@ function prompt_smiley_precmd {
 
 function prompt_smiley_setup {
   unsetopt XTRACE KSH_ARRAYS
-  prompt_opts=(percent subst)
+  prompt_opts=(cr percent sp subst)
 
   # Add hook for calling git-info before each command.
   add-zsh-hook precmd prompt_smiley_precmd

From b6b43eb331a893d9a278c278b20534a2ca07aed0 Mon Sep 17 00:00:00 2001
From: Ashish Gandhi <ag@ashishgandhi.org>
Date: Mon, 16 Apr 2018 15:51:57 -0700
Subject: [PATCH 14/21] Rename "Mac OS X" to "macOS" in comments

This only changes references in text for human consumption. It leaves
out renaming paths because that can cause breaking changes.

Related issue https://github.com/sorin-ionescu/prezto/issues/1449.
---
 modules/README.md                             | 4 ++--
 modules/command-not-found/init.zsh            | 2 +-
 modules/osx/README.md                         | 6 +++---
 modules/osx/functions/osx-ls-download-history | 2 +-
 modules/osx/functions/osx-rm-download-history | 2 +-
 modules/osx/init.zsh                          | 2 +-
 modules/perl/README.md                        | 4 ++--
 modules/perl/init.zsh                         | 2 +-
 modules/python/init.zsh                       | 2 +-
 modules/rsync/README.md                       | 2 +-
 modules/rsync/init.zsh                        | 2 +-
 modules/tmux/README.md                        | 4 ++--
 modules/utility/init.zsh                      | 2 +-
 runcoms/zpreztorc                             | 2 +-
 14 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/modules/README.md b/modules/README.md
index 1c2cdc54..3c7392cf 100644
--- a/modules/README.md
+++ b/modules/README.md
@@ -122,7 +122,7 @@ Initializes OCaml package management.
 OSX
 ---
 
-Defines Mac OS X aliases and functions.
+Defines macOS aliases and functions.
 
 Pacman
 ------
@@ -132,7 +132,7 @@ Provides aliases and functions for the Pacman package manager and frontends.
 Perl
 ----
 
-Enables local Perl module installation on Mac OS X and defines alises.
+Enables local Perl module installation on macOS and defines alises.
 
 Prompt
 ------
diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh
index 0e778031..40892560 100644
--- a/modules/command-not-found/init.zsh
+++ b/modules/command-not-found/init.zsh
@@ -12,7 +12,7 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
 # Load command-not-found on Arch Linux-based distributions.
 elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
   source '/usr/share/doc/pkgfile/command-not-found.zsh'
-# Load command-not-found on Mac OS X when homebrew tap is configured.
+# Load command-not-found on macOS when homebrew tap is configured.
 elif (( $+commands[brew] )) && brew command command-not-found-init > /dev/null 2>&1; then
   eval "$(brew command-not-found-init)"
 # Return if requirements are not found.
diff --git a/modules/osx/README.md b/modules/osx/README.md
index 870b4864..1f93a2c3 100644
--- a/modules/osx/README.md
+++ b/modules/osx/README.md
@@ -1,7 +1,7 @@
 OSX
 ===
 
-Defines [Mac OS X][1] aliases and functions.
+Defines [macOS][1] aliases and functions.
 
 Settings
 --------
@@ -34,8 +34,8 @@ Functions
   - `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
   - `ql` previews files in Quick Look.
   - `osx-rm-dir-metadata` deletes .DS\_Store, \_\_MACOSX cruft.
-  - `osx-ls-download-history` displays the Mac OS X download history.
-  - `osx-rm-download-history` deletes the Mac OS X download history.
+  - `osx-ls-download-history` displays the macOS download history.
+  - `osx-rm-download-history` deletes the macOS download history.
 
 Authors
 -------
diff --git a/modules/osx/functions/osx-ls-download-history b/modules/osx/functions/osx-ls-download-history
index ba6a40c7..8b6eaab2 100644
--- a/modules/osx/functions/osx-ls-download-history
+++ b/modules/osx/functions/osx-ls-download-history
@@ -1,5 +1,5 @@
 #
-# Displays the Mac OS X download history.
+# Displays the macOS download history.
 #
 # Authors:
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
diff --git a/modules/osx/functions/osx-rm-download-history b/modules/osx/functions/osx-rm-download-history
index c6a368ca..068ba3db 100644
--- a/modules/osx/functions/osx-rm-download-history
+++ b/modules/osx/functions/osx-rm-download-history
@@ -1,5 +1,5 @@
 #
-# Deletes the Mac OS X download history.
+# Deletes the macOS download history.
 #
 # Authors:
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
diff --git a/modules/osx/init.zsh b/modules/osx/init.zsh
index edf6ed3d..f7871ca7 100644
--- a/modules/osx/init.zsh
+++ b/modules/osx/init.zsh
@@ -1,5 +1,5 @@
 #
-# Defines Mac OS X aliases and functions.
+# Defines macOS aliases and functions.
 #
 # Authors:
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
diff --git a/modules/perl/README.md b/modules/perl/README.md
index 092c9224..67f2a177 100644
--- a/modules/perl/README.md
+++ b/modules/perl/README.md
@@ -1,14 +1,14 @@
 Perl
 ====
 
-Enables local [Perl][1] module installation on Mac OS X and defines aliases.
+Enables local [Perl][1] module installation on macOS and defines aliases.
 
 Local Module Installation
 -------------------------
 
 Perl versions older than 5.14 do not support the local installation of Perl
 modules natively. This module allows for local installation of Perl modules on
-Mac OS X in *~/Library/Perl/5.12* by altering the environment.
+macOS in *~/Library/Perl/5.12* by altering the environment.
 
 ### Usage
 
diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh
index ffd5f0df..3bed6388 100644
--- a/modules/perl/init.zsh
+++ b/modules/perl/init.zsh
@@ -1,5 +1,5 @@
 #
-# Enables local Perl module installation on Mac OS X and defines aliases.
+# Enables local Perl module installation on macOS and defines aliases.
 #
 # Authors:
 #   Sorin Ionescu <sorin.ionescu@gmail.com>
diff --git a/modules/python/init.zsh b/modules/python/init.zsh
index bb48f6cd..b7c20272 100644
--- a/modules/python/init.zsh
+++ b/modules/python/init.zsh
@@ -19,7 +19,7 @@ elif (( $+commands[pyenv] )); then
   eval "$(pyenv init -)"
 
 # Prepend PEP 370 per user site packages directory, which defaults to
-# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The
+# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The
 # path can be overridden using PYTHONUSERBASE.
 else
   if [[ -n "$PYTHONUSERBASE" ]]; then
diff --git a/modules/rsync/README.md b/modules/rsync/README.md
index b418780b..77d78ea5 100644
--- a/modules/rsync/README.md
+++ b/modules/rsync/README.md
@@ -3,7 +3,7 @@ Rsync
 
 Defines [rsync][1] aliases.
 
-Mac OS X users are encouraged to use [Bombich's rsync][2], which has HFS+
+macOS users are encouraged to use [Bombich's rsync][2], which has HFS+
 enhancements.
 
 Aliases
diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh
index 3afebdb4..a802222f 100644
--- a/modules/rsync/init.zsh
+++ b/modules/rsync/init.zsh
@@ -20,7 +20,7 @@ if grep -q 'xattrs' <(rsync --help 2>&1); then
   _rsync_cmd="${_rsync_cmd} --acls --xattrs"
 fi
 
-# Mac OS X and HFS+ Enhancements
+# macOS and HFS+ Enhancements
 # http://help.bombich.com/kb/overview/credits#opensource
 if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then
   _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
diff --git a/modules/tmux/README.md b/modules/tmux/README.md
index 3d742ba6..0738d7cf 100644
--- a/modules/tmux/README.md
+++ b/modules/tmux/README.md
@@ -62,7 +62,7 @@ Aliases
 Caveats
 -------
 
-On Mac OS X, launching tmux can cause the error **launch_msg(...): Socket is not
+On macOS, launching tmux can cause the error **launch_msg(...): Socket is not
 connected** to be displayed, which can be fixed by installing
 [reattach-to-user-namespace][3], available in [Homebrew][4], and adding the
 following to *tmux.conf*:
@@ -71,7 +71,7 @@ following to *tmux.conf*:
 set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
 ```
 
-Furthermore, tmux is known to cause **kernel panics** on Mac OS X. A discussion
+Furthermore, tmux is known to cause **kernel panics** on macOS. A discussion
 about this and Prezto has already been [opened][2].
 
 Authors
diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh
index 7f75fb83..942090d7 100644
--- a/modules/utility/init.zsh
+++ b/modules/utility/init.zsh
@@ -128,7 +128,7 @@ if zstyle -t ':prezto:module:utility:grep' color; then
   alias grep="${aliases[grep]:-grep} --color=auto"
 fi
 
-# Mac OS X Everywhere
+# macOS Everywhere
 if [[ "$OSTYPE" == darwin* ]]; then
   alias o='open'
 elif [[ "$OSTYPE" == cygwin* ]]; then
diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc
index c1091555..28b60054 100644
--- a/runcoms/zpreztorc
+++ b/runcoms/zpreztorc
@@ -93,7 +93,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
 # zstyle ':prezto:module:history-substring-search' globbing-flags ''
 
 #
-# OS X
+# macOS
 #
 
 # Set the keyword used by `mand` to open man pages in Dash.app

From f8f93d4b91ba59a3323baf0a1ed91c6c33da72b8 Mon Sep 17 00:00:00 2001
From: Kaleb Elwert <belak@coded.io>
Date: Sun, 29 Apr 2018 17:39:25 -0700
Subject: [PATCH 15/21] command-not-found: Directly source homebrew
 command-not-found handler

Fixes #1577, Fixes #1451
---
 modules/command-not-found/init.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh
index 40892560..2c59a4b3 100644
--- a/modules/command-not-found/init.zsh
+++ b/modules/command-not-found/init.zsh
@@ -13,8 +13,8 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
 elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
   source '/usr/share/doc/pkgfile/command-not-found.zsh'
 # Load command-not-found on macOS when homebrew tap is configured.
-elif (( $+commands[brew] )) && brew command command-not-found-init > /dev/null 2>&1; then
-  eval "$(brew command-not-found-init)"
+elif [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then
+  source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh'
 # Return if requirements are not found.
 else
   return 1

From 6e179f24ab606f5c38d12b333771b4ba6b087eba Mon Sep 17 00:00:00 2001
From: Casey McGinty <casey.mcginty@gmail.com>
Date: Mon, 30 Apr 2018 22:22:10 -0700
Subject: [PATCH 16/21] Export VIRTUAL_ENV_DISABLE_PROMPT when enabling
 virutalenv

Adding `export` ensures the define is available in the shell so pyenv
or virtualenvwrapper do not duplicate the virtualenv name on the
prompt.
---
 modules/python/init.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/python/init.zsh b/modules/python/init.zsh
index b7c20272..4bd38ad6 100644
--- a/modules/python/init.zsh
+++ b/modules/python/init.zsh
@@ -94,7 +94,7 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
   export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
 
   # Disable the virtualenv prompt.
-  VIRTUAL_ENV_DISABLE_PROMPT=1
+  export VIRTUAL_ENV_DISABLE_PROMPT=1
 
   # Create a sorted array of available virtualenv related 'pyenv' commands to
   # look for plugins of interest. Scanning shell '$path' isn't enough as they

From 2995b7d0c89d628a68ea789e21ea8f26ea8fa4d9 Mon Sep 17 00:00:00 2001
From: Casey McGinty <casey.mcginty@gmail.com>
Date: Sun, 6 May 2018 13:19:35 -0700
Subject: [PATCH 17/21] Update cache files when .zpreztorc file is modified

Fixes #1581
---
 modules/fasd/init.zsh   | 4 +++-
 modules/node/init.zsh   | 4 +++-
 modules/perl/init.zsh   | 2 +-
 modules/python/init.zsh | 4 +++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/fasd/init.zsh b/modules/fasd/init.zsh
index 113a8716..37babd8e 100644
--- a/modules/fasd/init.zsh
+++ b/modules/fasd/init.zsh
@@ -20,7 +20,9 @@ fi
 #
 
 cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh"
-if [[ "${commands[fasd]}" -nt "$cache_file" || ! -s "$cache_file"  ]]; then
+if [[ "${commands[fasd]}" -nt "$cache_file" \
+      || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
+      || ! -s "$cache_file"  ]]; then
   # Set the base init arguments.
   init_args=(zsh-hook)
 
diff --git a/modules/node/init.zsh b/modules/node/init.zsh
index 578c6424..0a516f0d 100644
--- a/modules/node/init.zsh
+++ b/modules/node/init.zsh
@@ -32,7 +32,9 @@ fi
 if (( $+commands[npm] )); then
   cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh"
 
-  if [[ "$commands[npm]" -nt "$cache_file" || ! -s "$cache_file" ]]; then
+  if [[ "$commands[npm]" -nt "$cache_file" \
+        || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
+        || ! -s "$cache_file" ]]; then
     # npm is slow; cache its output.
     npm completion >! "$cache_file" 2> /dev/null
   fi
diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh
index 3bed6388..b7a79479 100644
--- a/modules/perl/init.zsh
+++ b/modules/perl/init.zsh
@@ -43,7 +43,7 @@ if [[ "$OSTYPE" == darwin* ]]; then
   perl_path="$HOME/Library/Perl/5.12"
 
   if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
-    if [[ ! -s "$cache_file" ]]; then
+    if [[ "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" || ! -s "$cache_file" ]]; then
       perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
     fi
 
diff --git a/modules/python/init.zsh b/modules/python/init.zsh
index 4bd38ad6..45e9b8dd 100644
--- a/modules/python/init.zsh
+++ b/modules/python/init.zsh
@@ -149,7 +149,9 @@ if (( $#commands[(i)pip(|[23])] )); then
   # Detect and use one available from among 'pip', 'pip2', 'pip3' variants
   pip_command="$commands[(i)pip(|[23])]"
 
-  if [[ "$pip_command" -nt "$cache_file" || ! -s "$cache_file" ]]; then
+  if [[ "$pip_command" -nt "$cache_file" \
+        || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
+        || ! -s "$cache_file" ]]; then
     # pip is slow; cache its output. And also support 'pip2', 'pip3' variants
     $pip_command completion --zsh \
       | sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null

From ae23bedd24268778eb8e66c8aaea740d64f3d2f3 Mon Sep 17 00:00:00 2001
From: Jeff Widman <jeff@jeffwidman.com>
Date: Sun, 20 May 2018 14:06:54 -0700
Subject: [PATCH 18/21] Document macOS support for `command-not-found`

Document macOS support for `command-not-found`
---
 modules/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/README.md b/modules/README.md
index 3c7392cf..1ff4e612 100644
--- a/modules/README.md
+++ b/modules/README.md
@@ -20,7 +20,7 @@ Integrates zsh-autosuggestions into Prezto.
 Command-Not-Found
 -----------------
 
-Loads the command-not-found tool on Debian-based distributions.
+Loads the command-not-found tool on macOS or Debian-based distributions.
 
 Completion
 ----------

From 3d911cd51189c806d8e2b1a3b8b83f7fcbd56aec Mon Sep 17 00:00:00 2001
From: Jeff Widman <jeff@jeffwidman.com>
Date: Sun, 20 May 2018 13:48:14 -0700
Subject: [PATCH 19/21] Document `gpf` vs `gpF`

Document the difference between `gpf` and `gpF`. These were changed in https://github.com/sorin-ionescu/prezto/pull/1040 / https://github.com/sorin-ionescu/prezto/commit/ddfc870f9aae4f43da10863a175cee2c91485cde, but never documented.
---
 modules/git/README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/git/README.md b/modules/git/README.md
index 1d4b7ba5..a4978262 100644
--- a/modules/git/README.md
+++ b/modules/git/README.md
@@ -233,7 +233,8 @@ zstyle ':prezto:module:git:alias' skip 'yes'
 ### Push
 
   - `gp` updates remote refs along with associated objects.
-  - `gpf` forcefully updates remote refs along with associated objects.
+  - `gpf` forcefully updates remote refs along with associated objects using the safer `--force-with-lease` option.
+  - `gpF` forcefully updates remote refs along with associated objects using the riskier `--force` option.
   - `gpa` updates remote branches along with associated objects.
   - `gpA` updates remote branches and tags along with associated objects.
   - `gpt` updates remote tags along with associated objects.

From 92e668e1d92e01e599c79db939e386b60bb33e4a Mon Sep 17 00:00:00 2001
From: Christopher Bowns <github@cbowns.com>
Date: Tue, 22 May 2018 18:44:57 -0700
Subject: [PATCH 20/21] Remove zlogout's Apu quote (#1583)

* Remove zlogout's Apu quote

For questions about why, see https://en.wikipedia.org/wiki/The_Problem_with_Apu

* Add a couple of random sayings per feedback in #1583
---
 runcoms/zlogout | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/runcoms/zlogout b/runcoms/zlogout
index 56b6b551..b5d9858c 100644
--- a/runcoms/zlogout
+++ b/runcoms/zlogout
@@ -8,11 +8,12 @@
 # Execute code only if STDERR is bound to a TTY.
 [[ -o INTERACTIVE && -t 2 ]] && {
 
-# Print the message.
-cat <<-EOF
+SAYINGS=(
+    "So long and thanks for all the fish.\n  -- Douglas Adams"
+    "Good morning! And in case I don't see ya, good afternoon, good evening and goodnight.\n  --Truman Burbank"
+)
 
-Thank you. Come again!
-  -- Dr. Apu Nahasapeemapetilon
-EOF
+# Print a randomly-chosen message:
+echo $SAYINGS[$(($RANDOM % ${#SAYINGS} + 1))]
 
 } >&2

From d4332e2faf420f73ada88397bee95dc4f1da6b97 Mon Sep 17 00:00:00 2001
From: Andrew Janke <floss@apjanke.net>
Date: Fri, 1 Jun 2018 03:36:21 -0400
Subject: [PATCH 21/21] Fix spelling error in CONTRIBUTING.md (#1590)

---
 CONTRIBUTING.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7800b818..f4dc0d61 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,7 +32,7 @@ there are a number of additional things to keep in mind.
    - Prefer `zstyle` over environment variables for configuration.
    - Prefer (( ... )) over [[ ... ]] for arithmetic expression.
    - Use the function keyword to define functions.
-   - The 80 character hard limit can be waved for readability.
+   - The 80 character hard limit can be waived for readability.
 
 #### Using an Alternative zprezto Directory