Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fixes for #1795 (prompt_sorin) #1810

Merged

Conversation

ackerleytng
Copy link
Contributor

Fixes #1795

A similar fix will work for #1723

The issue here is that when the async worker dies for whatever reason, prompt_sorin_async_tasks doesn't know about it and calls async_job on a worker that is not existent.

Between zsh-async v1.1.0 and v1.7.0, the change that made this difference is that in the newest version v1.7.2, zsh-async (I believe, correctly) checks for an error message (hup, nval or err) and stops the worker. In v1.1.0, it did not stop the worker, so _async_zle_watcher ends up calling async_process_results many, many times in an infinite loop, causing zsh to take up 100% CPU.

Proposed Changes

  • Reinitialize the worker on the last callback from _async_zle_watcher
  • Also always start the worker in prompt_sorin_async_tasks (Initializing the worker is handled idempotently by zsh-async)

@ackerleytng
Copy link
Contributor Author

The error can be reproduced reliably this way:

  1. Start zsh
  2. See that zsh has one child (probably the async manager)
  3. Kill the child with kill -9
  4. Press enter in the zsh where that child was killed

Now if you switch to v1.1.0, the message goes away, but the zsh instance whose child was killed goes into some kind of infinite loop and takes 100% CPU.

Got a hint here from straceing the zsh process with an infinite loop, and seeing lots of stuff related to WINCH and /dev/null.

I understand that #1805 might fix this issue, didn't try that yet. This proposal also explains the root cause!

I think this is a better fix because it does not rely on the idempotency of
async_start_worker and async_register_callback
@belak
Copy link
Collaborator

belak commented Mar 29, 2020

Thanks for doing more research on this! I've been unsuccessfully been trying to nail this down for quite some time.

@belak belak merged commit 5b03d7f into sorin-ionescu:master Mar 29, 2020
@jeffwidman
Copy link
Collaborator

jeffwidman commented Mar 31, 2020

Nice job @ackerleytng

Also, what do you mean a similar fix will work for #1723? To me they look unrelated...

@ackerleytng
Copy link
Contributor Author

I'm so sorry I meant a similar fix will work for #1736, the prompt_pure version of the issue.

Eventually I actually ported code from the latest version of prompt_pure, so this error probably wouldn't come up for prompt_pure.

@ackerleytng
Copy link
Contributor Author

This is the commit from zsh-async that checks and stops the worker.

mafredri/zsh-async@43de5e0

And the fix I ported was from this commit

sindresorhus/pure@0e3e777

This was committed on January 13 last year, but we've been using an older version of prompt_pure in prezto until @synasius noticed this on Feb 6 #1736 (comment)

So it matches up!

code2k pushed a commit to code2k/prezto that referenced this pull request Apr 5, 2020
* commit '5b03d7fa32cae51cee7903d3338f87c2d7d89657':
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  Update syntax-highlighting module
  prompt: update powerlevel10k submodule to v1.4.0
jat255 pushed a commit to jat255/prezto that referenced this pull request May 4, 2020
dcato added a commit to dcato/prezto that referenced this pull request May 6, 2020
* 'master' of https://github.com/sorin-ionescu/prezto:
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  Update syntax-highlighting module
  prompt: update powerlevel10k submodule to v1.4.0
  prompt: update powerlevel10k submodule to v1.3.0
  use $TTY instead of $(tty); it's faster and more reliable

# Conflicts:
#	modules/prompt/external/powerlevel10k
joelbcastillo added a commit to joelbcastillo/prezto that referenced this pull request May 9, 2020
* upstream/master: (108 commits)
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  Update syntax-highlighting module
  prompt: update powerlevel10k submodule to v1.4.0
  prompt: update powerlevel10k submodule to v1.3.0
  use $TTY instead of $(tty); it's faster and more reliable
  prompt: update powerlevel10k submodule to v1.2.0
  Updated prompt pure to version 1.11.0
  prompt: update powerlevel10k submodule to v1.1
  Update documentation
  environment: improve the TTY check (sorin-ionescu#1785)
  node: suppress node-info when nvm points system-wide node (sorin-ionescu#802)
  prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1784)
  ...
alexg0 pushed a commit to alexg0/prezto that referenced this pull request May 27, 2020
autermann added a commit to autermann/prezto that referenced this pull request Jun 8, 2020
* upstream/master: (511 commits)
  Make .zcomp* location configurable (sorin-ionescu#1842)
  prompt: update powerlevel10k submodule to v1.11.0
  prompt: update powerlevel10k submodule to v1.10.0
  [git] Add git pull autostash alias
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  Update syntax-highlighting module
  prompt: update powerlevel10k submodule to v1.4.0
  prompt: update powerlevel10k submodule to v1.3.0
  use $TTY instead of $(tty); it's faster and more reliable
  prompt: update powerlevel10k submodule to v1.2.0
  Updated prompt pure to version 1.11.0
  prompt: update powerlevel10k submodule to v1.1
  ...
trongrg added a commit to trongrg/prezto that referenced this pull request Jul 9, 2020
# By Kaleb Elwert (80) and others
# Via GitHub (2) and Kaleb Elwert (1)
* upstream/master: (322 commits)
  prompt: update powerlevel10k submodule to v1.12.0
  git-info: use tab as separator for splitting ahead_and_behind (sorin-ionescu#902)
  Ask pyenv whether pip exists if installed (sorin-ionescu#1848)
  Remove `--all` from git alias `glg` (sorin-ionescu#1853)
  Make .zcomp* location configurable (sorin-ionescu#1842)
  prompt: update powerlevel10k submodule to v1.11.0
  prompt: update powerlevel10k submodule to v1.10.0
  [git] Add git pull autostash alias
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  Update syntax-highlighting module
  prompt: update powerlevel10k submodule to v1.4.0
  prompt: update powerlevel10k submodule to v1.3.0
  ...

# Conflicts:
#	modules/autosuggestions/external
#	modules/completion/external
#	modules/prompt/external/agnoster
#	modules/prompt/external/pure
#	modules/syntax-highlighting/external
#	modules/utility/init.zsh
HJGreen pushed a commit to HJGreen/prezto that referenced this pull request Jul 16, 2020
weyhmueller added a commit to weyhmueller/prezto that referenced this pull request Jul 26, 2020
* 'master' of https://github.com/sorin-ionescu/prezto: (27 commits)
  completion: bump version to tags/0.32.0 (sorin-ionescu#1856)
  README: fix small grammatical error (sorin-ionescu#1857)
  utility, helper: add aliases to use with termux terminal emulator (android) (sorin-ionescu#1859)
  prompt: update powerlevel10k submodule to v1.12.0
  git-info: use tab as separator for splitting ahead_and_behind (sorin-ionescu#902)
  Ask pyenv whether pip exists if installed (sorin-ionescu#1848)
  Remove `--all` from git alias `glg` (sorin-ionescu#1853)
  Make .zcomp* location configurable (sorin-ionescu#1842)
  prompt: update powerlevel10k submodule to v1.11.0
  prompt: update powerlevel10k submodule to v1.10.0
  [git] Add git pull autostash alias
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  prompt: update powerlevel10k submodule to v1.5.0
  feat(helper): add os-type helper functions
  ...
rooney pushed a commit to rooney/prezto that referenced this pull request Aug 19, 2020
mjwestcott added a commit to mjwestcott/prezto that referenced this pull request Aug 23, 2020
* upstream/master: (25 commits)
  Add ^_ mapping to undo in viins mode (sorin-ionescu#1860)
  Add check for empty WORKON_HOME (sorin-ionescu#1861)
  completion: bump version to tags/0.32.0 (sorin-ionescu#1856)
  README: fix small grammatical error (sorin-ionescu#1857)
  utility, helper: add aliases to use with termux terminal emulator (android) (sorin-ionescu#1859)
  prompt: update powerlevel10k submodule to v1.12.0
  git-info: use tab as separator for splitting ahead_and_behind (sorin-ionescu#902)
  Ask pyenv whether pip exists if installed (sorin-ionescu#1848)
  Remove `--all` from git alias `glg` (sorin-ionescu#1853)
  Make .zcomp* location configurable (sorin-ionescu#1842)
  prompt: update powerlevel10k submodule to v1.11.0
  prompt: update powerlevel10k submodule to v1.10.0
  [git] Add git pull autostash alias
  Do not source history-substring-search if already loaded (sorin-ionescu#1830)
  prompt: update powerlevel10k submodule to v1.7.0
  homebrew: load helper dependency
  Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)
  fix: regression in homebrew module (sorin-ionescu#1816)
  prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)
  Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)
  ...
joshpaulchan pushed a commit to joshpaulchan/prezto that referenced this pull request Dec 10, 2020
ericbiewener pushed a commit to ericbiewener/prezto that referenced this pull request Dec 16, 2020
mnology pushed a commit to mnology/prezto that referenced this pull request Feb 1, 2021
mkucharek pushed a commit to mkucharek/prezto that referenced this pull request Feb 8, 2021
ivanalejandro0 pushed a commit to ivanalejandro0/prezto that referenced this pull request Feb 22, 2021
hghwng pushed a commit to hghwng/prezto that referenced this pull request Mar 15, 2021
wjaskowski pushed a commit to wjaskowski/prezto that referenced this pull request Mar 17, 2021
srajkovic pushed a commit to srajkovic/prezto that referenced this pull request Apr 26, 2021
to266 pushed a commit to to266/prezto that referenced this pull request May 11, 2021
evanrs pushed a commit to evanrs/prezto that referenced this pull request Aug 7, 2021
jaeyeun97 pushed a commit to jaeyeun97/prezto that referenced this pull request Jan 5, 2022
RIT80 pushed a commit to RIT80/prezto that referenced this pull request Jan 25, 2022
RIT80 added a commit to RIT80/prezto that referenced this pull request Jan 25, 2022
aspin pushed a commit to aspin/prezto that referenced this pull request Jul 19, 2022
* syntax-highlighting: Update README to clarify module load order

Fixes sorin-ionescu#1584

* completion: Compact path to global ssh known hosts file

* coreutils: update list of included coreutils (sorin-ionescu#1592)

* Fix broken gitref link in README.md

gitref.org points to services.github.com, and has been for some time[0].

[0] git/git-reference#112

* Make node-info work without nvm/nodenv

* Improve startup time by skipping pyenv rehash

After profiling startup time, I found that "pyenv rehash" is
by far the slowest piece. This change skips rehashing on init.

See pyenv/pyenv#784 (comment)

Also pass the shell explicitly, as suggested in
pyenv/pyenv#784 (comment),
which provides a modest improvement.

In total, this improves startup time from 1s to 0.3s on my machine.
Using the following command:
python -m timeit "__import__('subprocess').Popen(['zsh', '-i', '-c', 'echo']).communicate()"

Result before this change:
10 loops, best of 3: 1 sec per loop

Result after this change:
10 loops, best of 3: 334 msec per loop

* Update submodules (sorin-ionescu#1615)

This updates the submodules for autosuggestions, completion,
syntax-highlighting and the prompts async, powerlevel9k and pure.

All submodules that have TAGs/Releases were updated to their latest
TAG/release, except for syntax-highlighting because it's latest
release/TAG is from more than one year ago, and the project seems to be
well maintained but without releases.

* Correct alphabetical order in zprestorc

* Add explanation for extra git theme symbols in README.md

Helps with sorin-ionescu#1589

* [git] Also check "commondir" when looking for a stash (sorin-ionescu#1620)

* homebrew: Load standard Homebrew environment variables into shell session.

However, guard for legacy Homebrew as `brew shellenv` is relatively new.

* homebrew: Replace deprecated casks with their brew counterpart

Homebrew has deprecated `brew cask cleanup` and `brew cask search` in favor
of `brew cleanup` and `brew search` respectively. They will stop working on
2018-09-30. Further, `--outdated` has been removed.

We should eventually remove the related aliases, but for a while we keep
supporting them gracefully with deprecation warning.

The documentation has been removed from README.md, however.

* homebrew: Cleanup homebrew aliases

- 'brew upgrade' does 'brew update' by default, no need for explicit call
- replace 'brew remove' with 'brew uninstall' for consistency

* Updating submodules

For the submodules that have some kind of release (tags), they were
updated up to the most recent release. Otherwise, the submodule was
updated to the latest commit.

* python: use pure's magic value for VIRTUAL_ENV_DISABLE_PROMPT

Fixes sorin-ionescu#1627

* python: respect PYENV_ROOT if already set

Fixes sorin-ionescu#1578

* environment: only enable bracketed paste on non-dumb terminals

Fixes sorin-ionescu#1552

* doc: Bit of copyediting and formatting for consistency and clarification

* submodule: Updating submodules

'modules/prompt/external/async' updated to 'v1.7.1'
'modules/syntax-highlighting/external' updated to latest 'master'

* general: Miscellaneous documentation updates

- Add missing documentation for options and environment variables
- Rearrange definition and documentation of 'Options', 'Variables'
  and 'Aliases' in a consistent order

* doc: More copyediting and formatting for consistency

* Update submodule 'history-substring-search'

history-substring-search doesn't tag releases anymore and just maintains
the master branch -- switching to tracking master instead.

* prompt/steeef: Add basic support for editor_info and preview

* prompt/minimal: Add support for preview

* prompt/sorin: Minor cleanup and reordering

* Fix issue sorin-ionescu#1635. Option to disable GNU ls to group directories first.

* Update submodules

Updating to the latest released tags for modules:
completetion
syntax-highlighting

And for agnoster prompt

* Resolves sorin-ionescu#1641 - Roll the pure prompt back from 1.8.0 to 1.7.0

* Update submodules versions

* command-not-found: Restore idiomatic homebrewed handler loading on MacOS

As is the convention in prezto, we cache the command-not-found handler to
avoid incurring the performance penalty of loading ruby interpreter on
every call. This restores the 'Homebrew way' of loading command-not-found
handler.

Further, the formally recommended command lookup mechanism in Homebrew
(viz., `brew command command-not-found-init`) is ruby based and is super
slow. To avoid performance penalty, we `find` it ourselves from
`TAP_DIRECTORY` defined internally in Homebrew.

This also reinstates support for custom taps or non-standard Homebrew location.

* python: Make cached completion file mangling more reliable

While mangling cached completion file, we cannot just assume that
`$pip_command` would resolve to `pip` -- it might be `pip2` or `pip3`
depending on the relative position in zsh `$commands` array. Thus
replace the whole of 'pip*' with 'pip pip2 pip3' for compctl assignment.

* python: Use more apropriate filename for pip completion

* node: Cache completion for additional helpers

Add support for npm and additional well-known helper commands

* command-not-found: Support custom Homebrew tap on MacOS

Added support for homebrew-command-not-found from a non-default tap

* python: Fix pip compctl file match pattern

Make `sed` match more reliable while replacing the whole of 'pip*' with 
'pip pip2 pip3' for `compctl` assignment

* node: Make nvm lookup mechanism more efficient in homebrewed environment

In homebrewed environment, avoid using `brew --prefix nvm` which is
ruby based and is super slow. Instead, rely on homebrew standard
behavior wherein all installed packages are available in canonical
path $(brew --prefix)/opt/<package> (for nvm it would obviously be
`$(brew --prefix)/opt/nvm`).

NB: `$(brew --prefix)` (without additional argument) is a simple shell
shortcut and doesn't have the same performance impact.

* rsync: Update link to Bombich rsync page again

* syntax-highlighting: Further clarify relative module ordering

* Aliases to digital sign/verify commits and tags (sorin-ionescu#651)

* git: add documentation for new aliases

* archive: Enhance 'archive' helper to support multi file archive

We now allow multiple paths (files/directories) to be archived in
one shot. Validation of the target path(s) is now delegated to the
actual archive helper.

* homebrew: Simplify array assignment

No need for nesting array assignment only to flatten it later.

* homebrew: Load 'HOMEBREW_' prefixed variables only

Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH'
related variables as they are already handled in standard zsh 
configuration.

* command-not-found: Minor reformatting

* python: Expand compctl matches for pip variants

Expand `sed` match for more variants of 'pip*' (pip, pip2, pip3, pip2.7, 
pip3.7 etc.) for `compctl` assignment

* Remove duplicated information from git module README (sorin-ionescu#1657)

* python: Use brace expansion for pip compctl match

Just use brace expansion only (and not a mix of brace expansion and
path expansion) to expand `sed` match for more variants of 'pip*' (pip,
pip2, pip3, pip2.7, pip3.7 etc.) in `compctl` assignment

* Fix typo: gupl --> gulp (sorin-ionescu#1668)

* Updating submodules to lastest tags/master commits

* Remove old prompt tempfile and pid variable

This is a leftover of sorin-ionescu#1385, the temp file and the PID variable is not
needed any more.

* Update syntax-highlighting submodule

* remove mutually exclusive option

* editor: allow alt+arrow keys for word movement (sorin-ionescu#1688)

* archive: enhance parallel operations

* Add zstyle option to disable zsh option CORRECT

* Disable node-info output when value is system.

This makes the behavior consistent with rbenv and pyenv.

* Update zsh-autosuggestions submodule

* Add powerlevel10k theme (sorin-ionescu#1695)

* prompt: update powerlevel10k to latest commit

* prompt: update powerlevel10k submodule (sorin-ionescu#1715)

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1717)

A bunch of bug fixes. Most notably romkatv/powerlevel10k#89.

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1726)

Changes include a few bug fixes and a score of new features.

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1727)

The last update has picked up a nasty bug in gitstatus that disables all user aliases. This commit fixes it.

* Resolves 1641 - Checks whether the prompt is set to be managed or not. (sorin-ionescu#1723)

This is a new variable that will need to be set on all new prompts and
is not backwards compatible with custom prompts that are not prezto
managed, but use prezto's editor-info functionality. Updated the
README.md with additional information for themes.

* prompt: update powerlevel10k submodule to the latest commit

New feature: Configuration Wizard. Type `p10k configure` to
explore the unique styles and features Powerlevel10k has
to offer.

* prompt: update powerlevel10k submodule to the latest commit

A dozen bug fixes. Most important:

- rbenv and a few other segments didn't work if IFS was set
  to something unusual.
- vcs segment couldn't properly apply subsegment style if
  color overrides used mnemonic names.
- the check for .p10k.zsh already being sourced was too strict.

* prompt: update powerlevel10k submodule to the latest commit

- Several bug fixes. Most notable:
  - Don't hide command execution time on reset-prompt.
  - Support prezto with zsh 5.1.
  - Don't hide nvm prompt when there is no nvm command.
- New prompt: ranger.
- Add an option to hide rust version when outside of rust project tree.
- Add an option to show rvm gemset.

* syntax-highlighting: update external dependency

* prompt: update zsh-async to fix an infinite loop (sorin-ionescu#1734)

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1738)

- New prompt segment: terraform.
- Configuration wizard:
  - Offer to install Meslo Nerd Font (only on iTerm2 and Termux).
  - Offer to enable `time` prompt segment.
  - New style options: round separators, heads and tails.
  - Reduce the minimum required terminal width to 55 columns.
- Several bug fixes. Most notable:
  - Fix network interface and ip parsing on Linux and WSL.
  - Disregard auto_name_dirs if it's set.

* history: Permit use of previously set HISTFILE

Honor the use of the HISTFILE environment variable, if it's already set.

* directory: update docs to clarify it doesn't really set AUTO_NAME_DIRS (sorin-ionescu#1740)

Module `directory` used to set AUTO_NAME_DIRS. This was changed in
73e94b8 but README.md hasn't been updated. This looks like an
accidental omission that this commit fixes.

* ruby: support environment variable RBENV_ROOT

* node: support environment variables NVM_DIR and NODENV_ROOT

* python: improve PYENV_ROOT detection

* node, python, ruby: update docs about new envars

* tmux: ignore tmux autostart in vscode terminal (sorin-ionescu#1718)

In certain situations VSCODE_PID isn't set any more, so we just need to check TERM_PROGRAM which has existed for a few years already.

* utility: fix safe-ops commands

Fixes sorin-ionescu#1699

* Remove alias for invalid `brew cleanup --force`

`brew cleanup --force` produces the following error message: `Error: invalid option: --force`. I can't seem to find any record of this being a valid option for the cleanup command, so either it was deprecated in the stone age or it was a simple mistake. However, there is a `--force` option available for `brew uninstall`, but that's a dicey thing to alias.

* Init submodules when using zprezto-update (sorin-ionescu#1713)

* Remove documentation for obsolete `brewC` alias

* homebrew: add alias `brewL`

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1757)

- New feature: Instant Prompt.
  - Zsh starts instantly even if zshrc loads dozens of plugins.
  - Must be explicitly enabled via `p10k configure`.
- New prompt segment: azure.
- New styles: Pure and Rainbow.
- 6 times faster loading (independent of instant prompt).

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1761)

New feature: Transient Prompt.

Demo:
https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif

Announcement post:
https://www.reddit.com/r/zsh/comments/dsh1g3/new_powerlevel10k_feature_transient_prompt

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1768)

- New prompt segments:
  - gcloud
  - fvm
  - vim_shell
  - midnight_commander
  - goenv
- Many bug fixes and new minor features.

* Allow mapping Ctrl+S and Ctrl+Q shortcuts (sorin-ionescu#1750)

* environment: apply `stty -ixon` only to tty (sorin-ionescu#1771)

* runcoms: don't raise an error in zlogin when stderr is not a TTY (sorin-ionescu#1775)

The existing code in runcoms/zlogin results in `$?` being
equal to `1` when starting a login shell if stderr is not
a TTY. For example:

  zsh -l 2>/dev/null

When using a theme that displays error/success status of
the last command, the first prompt will show an error.

This commit fixes it so that error code is zero after
sourcing zlogin (unless something unexpected and bad happens).

* Support pmodule-allow-overrides feature (sorin-ionescu#1780)

* autosuggestions: update to v0.6.4

* Allow module functions directory to be a symlink

The link must still point to a full directory.

* prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1784)

- New features:
  - Show On Command -- Display prompt segments conditional on the
    command being typed. Demo:
    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif
  - `p10k display` -- Quickly hide or show different parts of prompt.
  - `p10k-on-*` hooks -- Get notified about prompt-related events.
- New prompt segments:
  - google_app_cred -- Google Application Credentials.
  - luaenv -- Lua version from https://github.com/cehoffman/luaen.
  - jenv -- Java version from https://github.com/jenv/jenv.
  - plenv -- Perl version from https://github.com/tokuhirom/plenv.
  - nnn -- Shell indicator for https://github.com/jarun/nnn.
- Important fixes:
  - Ctrl-C no longer shortens prompt when used to terminate a zle widget
    with transient prompt enabled.
  - Don't print warnings in instant prompt when OMZ is updating.
  - rust_version now properly recognized rustup overrides.
- Smoother rendering when using transient prompt.
- New style in `p10k configure`: Lean restricted to 8 colors.

* node: suppress node-info when nvm points system-wide node (sorin-ionescu#802)

On modern versions of nvm, when virtual environment is not activated
(i.e. node comes from system-wide and `nvm version` == 'system'),
redundant node-info could be suppressed from showing.

* environment: improve the TTY check (sorin-ionescu#1785)

Bug report from @qosmio:
sorin-ionescu#1771 (comment)

I'm unable to reproduce it and @qosmio hasn't yet confirmed or
disconfirmed whether this fix works. It's a good idea to change
the code this way in either case.

(As I mentioned in sorin-ionescu#1771, this `stty -ixon` call may have been added
by mistake. It doesn't do what the comment suggest and is at least as
likely to be harming users as helping them.)

* Update documentation

- Fix an old link to the wrong issue tracker
- Add documentation to the history module about migration from oh-my-zsh

Closes sorin-ionescu#1766

* prompt: update powerlevel10k submodule to v1.1

==[ Changes since the last release ]==

- Complete documentation overhaul. Powerlevel10k documentation is no
  longer embarrassing (still no reference though; coming "soon").
- Worker pool and recursive globber have been rewritten for better
  performance and simpler code. Performance improvements (large
  speedup means an improvement in big-O and at least 2x in typical
  configurations):
  - +15% prompt speedup across the board.
  - Large prompt speedup for several rarely used prompt segments
    (disk_usage, ram, etc.).
  - Large prompt speedup for a few prompt segments on macOS
    (battery, swap, etc.).
  - Large prompt speedup when many prompt segments are active
    simultaneously.
  - Large prompt speedup when filesystem is slow.
- New prompt segments: nix_shell and timewarrior. Both enabled by
  default.
- Configuration wizard:
  - Many new options for Pure style (color scheme, number of lines,
    etc.)
  - Several new options for 8-color version of Pure style.
  - Better support for terminals with less than 256 colors.
  - Lean, Classic and Rainbow style configs now have disk_usage and
    swap prompt segments (disabled by default).
  - POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER now contains 'oc'.
- New parameters:
  - POWERLEVEL9K_LEGACY_ICON_SPACING=true makes spaces around icons
    appear just like in powerlevel9k.
  - When in a vcs repo, POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=true
    removes directory prefix that precedes repo root.
  - P9K_KUBECONTEXT_USER can now be used in kubecontext format.
  - POWERLEVEL9K_GOENV_SOURCES -- the same as
    POWERLEVEL9K_RBENV_SOURCES but or go.
  - POWERLEVEL9K_TERRAFORM_CLASSES -- the same as
    POWERLEVEL9K_AWS_CLASSES but for terraform.
- Bug fixes:
  - Configuration wizard now correctly follows symlinks when modifying
    ~/.zshrc and ~/.p10k.zsh.
  - ram prompt segment now works on WSL.
  - Powerlevel10k now correctly works with zsh-you-should-use in
    hardcore mode.
  - POWERLEVEL9K_PUBLIC_IP_HOST now points to a host that actually
    works.
  - Instant prompt no longer prints nonsensical "entry=" in rare
    circumstances.
- Misc:
  - Config templates no longer work with
    POWERLEVEL9K_VISUAL_IDENTIFIER='' defined after them.
  - Powerlevel10k now detects when Antigen corrupts its source and
    emits an appropriate error message.
  - Command line parser now understands 'tabbed'.
  - Remove all references to romkatv/dotfiles-public. Fonts are now
    hosted in romkatv/powerlevel10k-media together with all images
    and animations.

==[ Build time dependencies ]==

- https://github.com/romkatv/gitstatus/tree/edb99aa7b86d10ad0a1cfe25135b57c8031d82ad
- https://github.com/romkatv/libgit2/tree/75be63625a0de418ec3551306362ee1e21034039
- https://opensource.apple.com/tarballs/libiconv/libiconv-51.200.6.tar.gz

* Updated prompt pure to version 1.11.0

* prompt: update powerlevel10k submodule to v1.2.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.2.0

* use $TTY instead of $(tty); it's faster and more reliable

`tty` command infers the current TTY from file descriptor 0.
`$TTY` gives current TTY directly. The latter works even when
file descriptor 0 is redirected. It's also over 1000 times faster.

* prompt: update powerlevel10k submodule to v1.3.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.3.0

* prompt: update powerlevel10k submodule to v1.4.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.4.0

* Update syntax-highlighting module

* feat(helper): add os-type helper functions

Add the following functions:

- is-darwin
- is-linux
- is-bsd
- is-cygwin

And apply them everywhere I found code doing that what these functions do.

* prompt: update powerlevel10k submodule to v1.5.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.5.0

* Fix missing dependency on helper module for helpers added in sorin-ionescu#1793 (sorin-ionescu#1811)

PR sorin-ionescu#1793 introduced helper functions for OS detection in some modules.
These helpers require a module dependency on the 'helper' module.

* prompt: fix usage of zsh-async in sorin prompt (sorin-ionescu#1810)

* fix: regression in homebrew module (sorin-ionescu#1816)

* Use shallow clone for powerlevel9k and powerlevel10k submodules (sorin-ionescu#1819)

* homebrew: load helper dependency

Updates sorin-ionescu#1815

* prompt: update powerlevel10k submodule to v1.7.0

Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.6.0
  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.6.1
  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.7.0

* Do not source history-substring-search if already loaded (sorin-ionescu#1830)

* [git] Add git pull autostash alias

Adds the gfma and gfra aliases with the `--autostash` flag.

* prompt: update powerlevel10k submodule to v1.10.0

Release notes:

- https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.0
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.1
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.2
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.9.0
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.9.1
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.10.0

* prompt: update powerlevel10k submodule to v1.11.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.11.0

* Make .zcomp* location configurable (sorin-ionescu#1842)

* Remove `--all` from git alias `glg` (sorin-ionescu#1853)

* Ask pyenv whether pip exists if installed (sorin-ionescu#1848)

Pyenv will install shims for commands that exist in any interpreter, even if it is not the current one. This means that a command may technically exist, but when executed will tell the user to try a different interpreter. The original check for pip in the Python module can fail for this reason, in particular on Ubuntu 20.04.

This change checks with pyenv whether pip really exists in the current interpreter to work around this problem and fixes a bug in pip command detection.

* git-info: use tab as separator for splitting ahead_and_behind (sorin-ionescu#902)

The current implementation is not tamper-proof against a modified IFS. See discussion in sorin-ionescu#902 for details.

* prompt: update powerlevel10k submodule to v1.12.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.12.0

* utility, helper: add aliases to use with termux terminal emulator (android) (sorin-ionescu#1859)

* README: fix small grammatical error (sorin-ionescu#1857)

* completion: bump version to tags/0.32.0 (sorin-ionescu#1856)

* Add check for empty WORKON_HOME (sorin-ionescu#1861)

When $WORKON_HOME is not set and $ENV_NAME is equal to
$PROJECT_ROOT/.venv which contains bin/activate then
the code wrongly assumes workon is available.

It should execute the second branch to source bin/activate.

* Add ^_ mapping to undo in viins mode (sorin-ionescu#1860)

This allows to cancel a tab completion, as ^_ in emacs mode.

* prompt: update powerlevel10k submodule to v1.13.0

Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.13.0

* prompt: update powerlevel10k submodule to v1.14.3

Release notes:

- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.0
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.1
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.2
- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.3

* prompt: update powerlevel10k submodule to v1.14.4

Release notes:

- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.4

* prompt: update powerlevel10k submodule to v1.14.5

Release notes:

- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.5

* prompt: update powerlevel10k submodule to v1.14.6

Release notes:

- https://github.com/romkatv/powerlevel10k/releases/tag/v1.14.6

* Fix a typo s/eigth/eighth/

* Update history-substring-search submodule to v1.0.2

* Enable `history-substring-search` as a default module

Resolves sorin-ionescu#1868

* osx module mand fix

> The {query} has to be percent-escaped in macOS 11.

Just replace `:` to `%3A` work fine.

But add function like this one I find on stackoverflow to encode the entire query string would be more robust.
```bash
urldecode() {
    # urldecode <string>

    local url_encoded="${1//+/ }"
    printf '%b' "${url_encoded//%/\\x}"
}
```

* history: Minor formatting update

* history: Update doc to accommodate recent macOS

In recent versions of macOS (Catalina and above), `HISTFILE` is set
via system `/etc/zshrc`.

* prompt: Remove Powerlevel9k

Powerlevel9k has been marked deprecated and unmaintained by the author.
Powerlevel10k is now the recommended replacement.

See: https://github.com/Powerlevel9k/powerlevel9k#powerlevel9k-is-deprecated-and-now-unmaintained-please-use-powerlevel10k

* prompt: Make 'powerlevel9k' removal warning message friendlier

* Add support for zstd compressed tarballs to module 'archive'

* base: Allow loading more specific 'run-help' function

Allow loading more specific 'run-help' function from $fpath. This
allows automatically looking up specific sub-command helper if
available instead of the static default ('man').

See: https://github.com/zsh-users/zsh/blob/ccc9cff9e244725ed604fd1ac20e4958339e3885/Functions/Misc/run-help#L3-L8

* utility: Autoload helper functions for 'run-help'

Now that, prezto is configured to lookup more specific 'run-help'
function, autoload the known ones for utility.

* git: Autoload helper functions for 'run-help'

Now that, prezto is configured to lookup more specific 'run-help'
function, autoload the known one for git.

* command-not-found: Simplify Homebrew on macOS setup

Now that 'command-not-found' helper loading has been significantly
simplified and the startup time improved in the official Homebrew tap,
the workaround for script detection (and caching) can be removed.

* prompt: Update 'powerlevel9k' removal warning with instruction

* command-not-found: Update docs for Homebrew

Update documentation for Homebrew to indicate that a recent version of 
Homebrew does not need to tap `command-not-found` Homebrew repository.

* prompt: Fixup `~/.zpreztorc` in p9k removal warning

* Ensure compinit updates its modified date

`compinit -i` doesn't always change zcompdump, which means that the
`compinit -C` condition fails to run until the completions change.
When we `compinit -i`, we should touch the file too to solve this.

* completion: Add note about keep zcompdump younger than cache time

* Delete prompt_powerlevel9k_setup

I think this should have been removed as part of sorin-ionescu@0a07ba2.

Currently I'm seeing this warning after updating to `master`:
```
Couldn't read file /Users/jeffwidman/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup containing theme powerlevel9k.
```

* base: Check for 'run-help' in `aliases` hash before evicting

Add guard to check for presence of 'run-help' in `aliases` hash before evicting.
In some systems (like Debian) '/etc/zshrc' might have already done it.

* helper: Update docs for OS detection helpers

* archive: Remove unnecessary interpreter directive

These files are expected to be `source`d in and not executed standalone.

* homebrew: cask aliases update

* homebrew: Remove wrapper function for deprecation warning

* homebrew: Add 'brew upgrade' alias for cask

This adds alias for 'brew upgrade --cask' specifically for casks
via alias 'casku' (analogous to 'brewu').

* homebrew: Update documentation

* history: Move HISTFILE path to more conventional one

Change default `HISTFILE` path from `~/.zhistory` to more conventional
`~/.zsh_history`. This aligns better with Debian variants, macOS and
Oh My Zsh.

This would provide an easier onboarding experience to users coming to
Prezto from standard (framework free) zsh or from Oh My Zsh.

For existing Prezto users, we attempt to automatically rename old
`HISTFILE` to new one iff the old one exists and the new one doesn't.
However, if both old and new `HISTFILE` exist and the old one is more
recent, we just alert the user about what changed with a suggested way
to accommodate the change.

* completion: Add completion for keg-only brewed curl when available

As curl bundled with macOS does not include `_curl` definitions, one
way to make `_curl` available is to install curl from Homebrew.

However, since curl from Hombrew is _keg-only_, its function path needs
to be explicitly included.

* node: Fixup nvm path detection for Homebrew based nvm

Prefer using `brew --prefix nvm` instead of just `brew --prefix` and
actually use the variable `nvm_prefix` once detected and set up.

* rsync: Remove broken HFS+ specific compression flag

Remove `--protect-decmpfs` by default since hfs-compression specific
changes have been marked by upstream as broken since 3.1.3 and there is
little likelihood of that changing.

* rsync: Check for new rsync before applying newer options

The newer options for extended attributes or file-flags got reliable
only after rsync v3.1.

* rsync: Recommend Homebrew or MacPorts rsync for macOS

Bundled `rsync` is 2.6.x which is too old. Prefer 3.2.x from Homebrew
or MacPorts instead.

* environment: Simplify nested conditional block

Avoid unnecessary nesting for conditional block.

* general: Reformat documentation with better formatting and wording

General purpose reformating and rewording in (a few places). This should
also make markdown linting happier.

Prefer back-ticks wherever useful and use `console` for code blocks to
be executed on terminal.

Also, update references links wherever possible (including update from
'http://' to 'https://').

* history: use external `mv` command for HISTFILE migration

This will make sure the actual external command `mv` is used instead of
wrapper function.

* prompt: Fix git submodule path for 'pure' with actual path

WARNING: This will require synchronizing submodules' remote URL
configuration setting to the value specified in `.gitmodules` by doing:
`git submodule sync --recursive` in your Prezto location.

Signed-off-by: Indrajit Raychaudhuri <[email protected]>

* general: Apply submodules' path change in doc and `zprezto-update`

We need to accommodate cases where a submodule local path (or remote)
URL can change. Accordingly, update instruction and `zprezto-update`
function to synchronizes submodules' remote URL configuration setting
to the updated value automatically.

* completion: Update zsh-completions submodule to 0.33.0

* prompt: Update async helper to 1.8.5

* utility: Detect GNU 'ls' before applying the relevant tweaks

Detect `ls` provided by GNU Core Utilities upfront before applying
the relevant settings and aliases.

The revised logic takes the following aspects into consideration:
- `is-callable 'dircolors'` is not a sufficient test for verifying if
  the `ls` in scope is _also_ provided by GNU Core Utilities. `ls` can
  continue to be the one provided by BSD Core Utilities because of its
  precedence in `$path`.
- The `ls` in scope anyway can be either GNU Utils provided or BSD Utils
  provided depending on either `$path` precedence, soft link (via
  `ln -s`), or wrapper function (via 'gnu-utility' module).
- So instead of '_guessing_' the possible one, just detect if it is from
  GNU Utils and apply the relevant settings and aliases.
- Note that GNU prefixed `ls` (`gls`) is intentionally not honored in
  this case to avoid possible conflict/shadowing with other `gls`
  callable (can happen if 'git' module is used, for example).
  Besides, honoring `gls` would imply we honor other commands (like
  `mv`, `rm` etc.) to be consistent. We have a module 'gnu-utils'
  dedicated for that after all.

* general: Update documentation better qualifying runcom paths

Zsh and Prezto files don't always reside in `~/`. Instead, they have
a more spec compliant location (`${ZDOTDIR:-$HOME}/`). Make them
unambiguous in the documentation. Likewise, for `$GNUPGHOME`.

Further, add instruction for optionally setting up Prezto in
`$XDG_CONFIG_HOME`.

While at this, also add clarification on relative ordering of some of
the modules, apply more formatting tweaks and doc improvements.

* utility: Honor pre-defined COLOR settings for grep

Honor `GREP_COLOR` or `GREP_COLORS` if already defined for coloring
`grep` output.

* utility: Check best-fit Python version for 'http-serve'

When creating `http-serve` alias, first check if Python is actually
available. And, if available, apply the most specific version.

* zprofile: Don't exit 'less' when everything fits the screen

This aligns better with default `less` behavior and allows for
'growable content' when `less` is used as a substitute for `tail`.

* utility: Always use 'git' fallback for 'wdiff' wrapper

Use `git` fallback (if present) even when color is off and `wdiff` is
not present.

Further, remove redundant `function` clause as per Prezto convention.

* utility: Remove redundant `function` clause in 'diff'

We don't use `function` clause in Prezto by convention.

* utility: Use Zsh native mechanism to detect GNU 'du'

Skip additional call to `grep` and use Zsh native mechanism to detect
GNU version of `du`.

Further, Remove redundant `function` clause as per Prezto convention.

* utility: Simplify conditional block for 'make' helper

Further, remove redundant `function` clause as per Prezto convention.

* gnu-utility: Add more utility commands and rearrange

Add missing `basenc`, `egrep`, `fgrep` etc. and reformat a bit.

* utility: Add support for 'aria2c' in 'get' alias

`get` alias now supports `aria2c` via optional `zstyle`.

To configure `aria2c` to be used for `get`, use:
zstyle -s ':prezto:module:utility:download' helper 'aria2c'

Note that we still fall back to `curl` when the desired download helper
isn't available.

* completion: Set standard style used by 'list-colors'

Set `LS_COLORS` if not already available so that it is available as
standard style `list-colors`.

This needs to be explicitly set in completion module to ensure that the
variable is available even if 'utility' module is not loaded earlier.

* node: Revamp and optimize 'node' module

Changes:
- nodenv and nvm now honors (and prioritizes) `$XDG_CONFIG_HOME` over
  `$HOME` to lookup local nodenv/nvm installation.
- Make `nvm` loading lazy (via `--no-use` argument).
- Remove redundant NODENV_ROOT or NVM_DIR, respective script already
  set them up.
- Adhere to more idiomatic Zsh operation and minimize external command
  usage (like `sed`).

* node: Prefer nodenv over nvm when available

Reverse `nodenv` vs `nvm` selection order, preferring `nodenv` instead.

For additional rationale, see: https://github.com/nodenv/nodenv/wiki/Why-nodenv%3F

* node: Optimize completions for loading lazily on demand

Move `grunt` and `gulp` to separate completion definitions wrapping
`grunt --completion=zsh` and `gulp --completion=zsh` respectively.

Since the completions are loaded lazily on demand, they avoid the
performance overhead during Zsh initialization.

Additionally, remove `npm` completion since it is already bundled with
Zsh for quite a while.

* node: Add environment variable to store 'n' cache

See: https://github.com/tj/n#installation for details.

* node: Add handy aliases for 'npm'

Add standard `npm` aliases that are used frequently.

* git: Alias and function cleanup and formatting for clarity

Changes:
- Prefer longer form of git switch for better clarity.
- Move `-S` (`--gpg-sign`) in all the alias definitions to  the end to
  allow custom keyid.
- Simplify operations in helper functions git native calls.
- Apply minor reformatting and rearranging.

* git: Optimize scripts for git helper functions

Optimize git internal calls and adjustment git helper functions to use
more idiomatic Zsh conventions avoiding external calls.

* git: Use `update` instead of `foreach` in alias 'gSu'

Modern `git` can use `submodule` option `update` instead of `foreach`
to achieve approximately similar outcome.

To allows call without assuming that all submodules will have default
branch as `master`, the preferred approach would be to call
`git submodule update --remote --recursive` after registering the
correct branch for submodule in `.gitmodules`:

```
git config -f .gitmodules submodule.<path>.branch <branch>
```

For more discussion, see: https://stackoverflow.com/a/33835815

Signed-off-by: Indrajit Raychaudhuri <[email protected]>

* git: Update minimum required git version to 2.11

Git 2.11+ has more versatile `submodule`, `fetch`, `rebase` options for
common use-cases.

* completion: Skip completion lookup for key-only brewed curl

Skip lookup for `_curl` completion function to avoid fallback
completion having higher priority.

* Fix broken source commands in node module

Placing `--no-use` inside the quoted string results in source
attempting to load a file which literally ends with ` --no-use`
instead of passing --no-use as an argument.

* completion: Avoid double-quoting LS_COLORS for completion

Double-quoting `LS_COLORS` prevents it from loading in environment,
which isn't what we want.

* python: Reformat and apply visual cleanup

Changes:
- Fallback to `virtualenvwrapper` without `pyenv` wrapper if `python` is
  available in path, regardless of whether `brew` is available.
- Look up for availability of `python2` and `python3`, not just `python`.
- Check for existence of path before adding to global `$path` array.
- Adhere to more idiomatic Zsh operation and minimize redundant syntaxes.
- Prefer looking up `$functions` for fully initialized `pyenv`.

* python: Optimize completion for loading lazily on demand

Move `pip` to separate completion definition delegating to pip to do
all the completion work.

Since the completion is loaded lazily on-demand, it avoids the
performance overhead during Zsh initialization.

Implementation note:
The helper function `_pip_completion` implementation is based on the
official pip completion function (which can be generated with
`pip completion --zsh`) adhering to the newer compsys style.

See: 'man zshcompsys' for more details.

* python: Update pyenv initialization flow per pyenv 2.0

In pyenv 2.0 onwards, it is not enough anymore to initialize pyenv in
shell by just calling `pyenv init -`. We also need to update `path` to
include pyenv shims by calling `pyenv init --path`.

Also, honor `$PYENV_ROOT` if set but, no need to set it explicitly if
not set. Instead, let the initialization script take care of that.

* ruby: Cleanup and optimize 'ruby' module

Changes:
- Honor `$RBENV_ROOT` or `RVM_DIR` if set but, no need to set it
  explicitly if not set. Instead, let the respective initialization
  scripts take care of that.
- Reverse `rbenv` vs `rvm` selection order, preferring `rbenv` instead.
- Check for availability of `rbenv` or `rvm` function instead of command
  to validate requirements. In a properly configured and initialized
  shell, `rbenv` or `rvm` will be available as function.
- Adhere to more idiomatic Zsh operation and minimize redundant syntaxes.

For additional rationale, see: https://github.com/rbenv/rbenv/wiki/Why-rbenv%3F

* completion: Unset local variable outside condition block

Unset `curl_prefix` outside condition block so that it is always
cleared. Also, avoid `brew --prefix <foo>` since it is triggering ruby
in fallback flow when `<foo>` is not present.

Also, apply minor formatting tweaks.

* node: Cleanup and optimize 'node' module

Changes:
- Simplify nodenv and nvm initialization
- Check for availability of `nodenv` or `nvm` function instead of command
- Unset local variables outside condition block

* prompt: update powerlevel10k submodule to v1.15.0

Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.15.0

* Add conda to the list of requirements

If conda is not in the list of requirements, the scripts exit too early in case pyenv is not installed and the module is configured with:

 zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on' 
 zstyle ':prezto:module:python' conda-init 'on'

Tested on Amazon EC2 Linux for Deeplearning AMI 47.0 and MacOS 11.4

* utility: Pipe diff output through colordiff Instead of aliasing

`colordiff` behaves better as `stdin` filter. This is useful in
retaining color escape sequences when used with `less`.

* general: Clarify relative ordering of modules in docs

* general: Reformat runcom documentation

* autosuggestions: Update zsh-autosuggestions to 0.7.0

* general: Correct typo in installation instructions

Resolves “zsh: bad substitution”

* change polarity of test for BROWSER

* prompt: update powerlevel10k submodule to v1.16.0

Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.16.0

* prompt: update powerlevel10k submodule to v1.16.1

Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.16.1

* Fix crash on open caused by incorrect conditional in python module

* Update Pure prompt to 1.20.0

* prompt: Update pure submodule to 1.20.1

* Only export env variables in zprofile if unset

As per [zsh documentation](https://zsh.sourceforge.io/Intro/intro_3.html) environment variables should be expected to be in `.zshenv` and not be overridden in `.zprofile`. This change modifies BROWSER (on darwin systems only), EDITOR, VISUAL, PAGER, LESS, and LESSOPEN to only use zprezto defaults if they were not previously set in the loading order.

See:
nix-community/home-manager#2739
nix-community/home-manager#2751

* zprofile: adjust condition for `LESSOPEN` export

Split tests for condition for `export LESSOPEN` separate per convention

* Allow users to set a dirty-branch format

* fix: use inflating binaries instead of deflating in unarchive function

* fix: use deflating flag for pixz in unarchive function

* completion: Detect Homebrew prefix internally, not idiomatically

For performance reasons, we prefer detecting Homebrew prefix internally
instead of the more idiomatic form `brew --prefix`.

We attempt looking up $HOMEBREW_PREFIX or $HOMEBREW_REPOSITORY first (in
case `brew shellenv` has been sourced-in earlier). Else, we look it up
by resolving absolute path of $HOMEBREW_REPOSITORY. $HOMEBREW_PREFIX is
same as $HOMEBREW_REPOSITORY except when Homebrew is installed in
'/usr/local' ($HOMEBREW_REPOSITORY == '/usr/local/Homebrew'). This is
usually the case for Intel Macs.

This should work for most standard (and officially documented) Homebrew
installations.

For implementation details in Homebrew,
see: https://github.com/Homebrew/brew/blob/2a850e02d8f2dedcad7164c2f4b95d340a7200bb/bin/brew#L62-L70

Co-authored-by: mattmc3 <[email protected]>

* command-not-found: Detect Homebrew repo internally, not idiomatically

For performance reasons, we prefer detecting Homebrew prefix internally
instead of the more idiomatic form `brew --repository`.

We attempt looking up $HOMEBREW_REPOSITORY first (in case `brew shellenv`
has been sourced-in earlier). Else, we look it up by resolving absolute
path of $HOMEBREW_REPOSITORY.

This should work for most standard (and officially documented) Homebrew
installations.

* zprofile: Expand the default list of well known paths

Two additional sets of paths are now added to the default list of well
known paths: '$HOME/{bin,sbin}' and '/opt/{homebrew,local}/{bin,sbin}'.

- '$HOME/{bin,sbin}': Most users have custom scripts in '$HOME/bin'
anyway, we might as well honor those. '$HOME/sbin' is not really common,
but we can keep it for consistency.
- '/opt/{homebrew,local}/{bin,sbin}': With Homebrew changing default
installation location in macOS on Apple Silicon which will eventually
become ubiquitous, we have a good reason to add these paths by default.
While at it, we also honor MacPorts installation.

In all cases, we add them _iff_ the paths actually exist, not otherwise.
This has the side effect of a newly installed program not available
immediately in the '$path' in a mint fresh system (because of the fact
that '/opt/{homebrew,local}/{bin,sbin}' won't exist initially) until the
shell is reloaded. But that's a minor inconvenience to keep the '$path'
from getting unnecessarily bloated.

* feat(module/history): add full configurability

While previusly configurable, it was inconsistent with other
configuration options and it was missing configurability of in memory /
on disc history size.

Signed-off-by: Shea690901 <[email protected]>

* fix: heading level for new hist file settings

* Update docker compose references

Docker For Mac has broken support for `docker-compose`. 

Since `docker compose` is a drop in replacement and it Just Works™, this PR converts `docker-compose` to `docker compose`

* Add Fig as an installation method to the README

Co-authored-by: Kaleb Elwert <[email protected]>
Co-authored-by: Indrajit Raychaudhuri <[email protected]>
Co-authored-by: Colin Hebert <[email protected]>
Co-authored-by: Tharre <[email protected]>
Co-authored-by: Michael Kohl <[email protected]>
Co-authored-by: Steven Loria <[email protected]>
Co-authored-by: Diego Rabatone Oliveira <[email protected]>
Co-authored-by: newtonne <[email protected]>
Co-authored-by: Bruce Clounie <[email protected]>
Co-authored-by: Yutian Li <[email protected]>
Co-authored-by: Tercio Gaudencio Filho <[email protected]>
Co-authored-by: Diego Rabatone Oliveira <[email protected]>
Co-authored-by: John P. Neumann <[email protected]>
Co-authored-by: Bruno Oliveira da Silva <[email protected]>
Co-authored-by: Jeff Widman <[email protected]>
Co-authored-by: Alexander Neumann <[email protected]>
Co-authored-by: Maxim Baz <[email protected]>
Co-authored-by: monai <[email protected]>
Co-authored-by: Chris Ewald <[email protected]>
Co-authored-by: Toshiki Murayama <[email protected]>
Co-authored-by: Roman Perepelitsa <[email protected]>
Co-authored-by: John P. Neumann <[email protected]>
Co-authored-by: Julien Brochet <[email protected]>
Co-authored-by: pedrosland <[email protected]>
Co-authored-by: Shane O'Grady <[email protected]>
Co-authored-by: laggardkernel <[email protected]>
Co-authored-by: Robson Roberto Souza Peixoto <[email protected]>
Co-authored-by: lambdanerd <[email protected]>
Co-authored-by: Wouter Overmeire <[email protected]>
Co-authored-by: Maxim Baz <[email protected]>
Co-authored-by: mattmc3 <[email protected]>
Co-authored-by: Ivan Smirnov <[email protected]>
Co-authored-by: Joost Cassee <[email protected]>
Co-authored-by: Jongwook Choi <[email protected]>
Co-authored-by: Federico Frenguelli <[email protected]>
Co-authored-by: Kaspar Vollenweider <[email protected]>
Co-authored-by: Charith Amarasinghe <[email protected]>
Co-authored-by: Ackerley Tng <[email protected]>
Co-authored-by: Srijan R Shetty <[email protected]>
Co-authored-by: Vladimir Bauer <[email protected]>
Co-authored-by: Zac Bergquist <[email protected]>
Co-authored-by: Amyn <[email protected]>
Co-authored-by: Texas Toland <[email protected]>
Co-authored-by: hidekuro <[email protected]>
Co-authored-by: Zhiming Wang <[email protected]>
Co-authored-by: Austin Sloane <[email protected]>
Co-authored-by: kwgchi <[email protected]>
Co-authored-by: Yasuharu Iida <[email protected]>
Co-authored-by: Olaf Conradi <[email protected]>
Co-authored-by: Matthieu PETIOT <[email protected]>
Co-authored-by: Kenichi Kamiya <[email protected]>
Co-authored-by: Yang Tang <[email protected]>
Co-authored-by: Herobs <[email protected]>
Co-authored-by: Poscat <[email protected]>
Co-authored-by: Roman Omarov <[email protected]>
Co-authored-by: bXV0ZQ <[email protected]>
Co-authored-by: Ehren Kret <[email protected]>
Co-authored-by: Thomas Blaschke <[email protected]>
Co-authored-by: Andrew Kvalheim <[email protected]>
Co-authored-by: David Crook <[email protected]>
Co-authored-by: zbirenbaum <[email protected]>
Co-authored-by: Aaron Kanter <[email protected]>
Co-authored-by: Jim Boulter <[email protected]>
Co-authored-by: Eugen Blattner <[email protected]>
Co-authored-by: Shea690901 <[email protected]>
Co-authored-by: Ben <[email protected]>
Co-authored-by: Ilkin Bayramli <[email protected]>
Co-authored-by: Sorin Ionescu <[email protected]>
Copy link

@ysoftman ysoftman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@evanrs evanrs mentioned this pull request Nov 1, 2022
dokai pushed a commit to dokai/prezto that referenced this pull request Nov 29, 2022
MohamedBassem pushed a commit to MohamedBassem/prezto that referenced this pull request Mar 11, 2023
dandrzejewski pushed a commit to dandrzejewski/prezto that referenced this pull request Aug 23, 2023
tjmcs pushed a commit to tjmcs/prezto that referenced this pull request Sep 1, 2023
glebec pushed a commit to glebec/prezto that referenced this pull request Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

async_job:zpty:12 no such pty command: prompt_sorin
4 participants