The `prompt_opts` array only has an effect when the theme is loaded via
promptinit (`prompt pure`). Previously they were not set when pure was
loaded via `source /path/to/pure.zsh` as is the case with e.g. antigen,
antibody, etc.
This commit attempts to detect whenever pure is not autoloaded via
promptinit and manually sets the options in `prompt_opts`.
Fixes#276.
Previously `command git rev-list --left-right --count HEAD...@'{u}'`
was run in a subshell, and upon `git fetch` completion, run once again.
This is now done as an async job (`prompt_pure_async_git_arrows`) and
is also called within `prompt_pure_async_git_fetch` to return the arrow
status immediately after `git fetch` has completed, this saves us from
waiting until the git fetch is done to only then execute a new async
job to check the arrow status.
Changes in git arrow / git dirty status are also handled better and
`prompt_pure_preprompt_render` is not called unless they actually
changed.
This commit fixes a problem where SSH (used by Git) is able to
interactively prompt for a password that can not be redirected to
`/dev/null`.
An interactive SSH password prompt inside the async worker does three
things:
1. Leave the `git fetch` hanging due to waiting for input
2. Capture part of the input to the async worker, thus creating
nonsense commands
3. Use some characters from future async jobs as a password and
attempts to login
Even if this was fixed in `zsh-async`, it is still good to disable the
password prompt to avoid issue numero uno.
Because @sorin-ionescu has been disappeared for about one year, the previous prezto repo is dead now. New actively maintained repo has been moved to zsh-users. See details on [this issue](https://github.com/sorin-ionescu/prezto).
Setting defer:0 is not necessary since this is the default zplug value.
Order is insignificant as long as zsh-async has been loaded before the pure precmd where the async worker is initialized.
We store the user setting for `prompt_subst` before changing it in the
local scope of `prompt_pure_preprompt_render`. This allows us to restore
it when we render the real prompt (`PS1`) through `zle .redraw-prompt`.
Fixes#230.
If a directory was named `hello world` (two spaces) this would
previously have resulted in pure trying to `cd` into `hello world` (one
space) to perform git actions. This issue was fixed in zsh-async 1.3.0.
There might also have been other cases, e.g. a newline in the directory
name.
By unsetting `prompt_subst` for the `prompt_pure_preprompt_render`
function we can avoid e.g. git branch names with a `$`-sign to be
expanded as parameters.
Fixes#224 and #225 (as a result of 6cbd49a).
* Compare expanded preprompt when rendering
The expanded content of the preprompt was not considered previously when
checking if the content had changed. E.g. path changes were never detected.
The typeset (definition) and assignment are performed on separate lines as it
would cause issues otherwise.
Fixes#213.
[antibody](https://github.com/getantibody/antibody) does basically the same thing as antigen, but it is faster.
Commands are similar, except for the `theme` command that doesn't even exist in antibody.