-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Improve startup time by skipping pyenv rehash #1603
Conversation
Marking as WIP because this breaks display of the current virtualenv in the prompt, even though the virtualenv gets correctly set using pyenv-virtualenv. |
Ah, without running
Furthermore, running $ pyenv rehash
basename: illegal option -- -
usage: basename string [suffix]
basename [-a] [-s suffix] string [...] @blueyed Any suggestions? Is there a way for |
modules/python/init.zsh
Outdated
|
||
# Load package manager installed pyenv into the shell session. | ||
elif (( $+commands[pyenv] )); then | ||
export PYENV_ROOT=$(pyenv root) | ||
eval "$(pyenv init -)" | ||
eval "$(pyenv init - zsh --no-rehash)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using zsh
here already makes sense by itself - and could go into a separate PR / commit.
Are you sure? |
Usage is wrong, should be
|
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
86a2e0f
to
21b6078
Compare
@blueyed Ah, good catch. Doing This is working now, and my startup time is now blazing fast. ⚡️ ⚡️ ⚡️ |
lgtm. @belak - thoughts? |
Seems good to me as well! |
LGTM as well |
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [#4492]: #4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
* Fast algorithm to determine grep alias flags This version tries whether grep supports all the flags together and progressively checks older flags if the grep test fails. This means only one grep call if all flags are supported, and one additional call for every flag that's not supported, up to a maximum of 3 calls. * Refactor grep.zsh file - Move grep-alias path to variable. - Use <<< "" instead of piped echo to check grep flags. - Remove check for --color only since it's the same release as --exclude. * Document ZSH_THEME_RANDOM_BLACKLIST setting * lib: use grep-alias cache only if ZSH_CACHE_DIR is writable Fixes ohmyzsh#8693 * pip: add local Python package files to completion (ohmyzsh#7442) * minikube: cache command completions (ohmyzsh#7446) * shrink-path: add minimum length and ellipsis symbol options (ohmyzsh#7382) * Added minimum length and ellipsis symbol options for the shrink-path plugin. * Replaced tab indentation with space indentation for the shrink-path plugin. * Added handling of multicharacter ellipsis, and updated documentation and README for the shrink-path plugin. * command-not-found: speed up call to Homebrew command-not-found (ohmyzsh#7740) By sourcing brew files directly we can achieve a very high speed up. This will not work if the user installed homebrew in a different location than by default. * python: add pyuserpaths function (ohmyzsh#7758) Summary Make it get a list of installed interpreters, and add the relevant local (HOME) site-packages directory to PYTHONPATH. Reason To easily add all relevant paths, initially, and between upgrades. Add check for PYTHONUSERBASE Summary Check for a non-standard install directory, use it if one exists, otherwise use ~/.local. Reason Allow users to specify their own installation directory, without affecting functionality. * sdk: add support for local versions and optimize sed calls (ohmyzsh#7870) * Added support for local sdk versions Added support for local versions (prefixed by '+'), so they are filtered out in _listInstallableVersions() and they are displayed correctly by _listAllVersion() * Optimize sed calls Co-authored-by: Marc Cornellà <marc.cornella@live.com> * Uppercase the issue in open issue command in the JIRA plugin * Better support for branch name Enable to get issue from branch prefixed with it and delimited by '_' * Clean up jira function * Some tweaks to the Jira plugin [x] Updating `branch` command to be compatible with git-flow style branches by removing any prefix before attempting to go to the ticket number in Jira. [x] Removing the switch between /browse/ and /issues/ based off of the `JIRA_RAPID_BOARD` setting - as all issues are under browse now it seems. * random: remove random theme from possible themes to choose from ...preventing an infinite loop. * lib: use `command` to run rm in upgrade function (ohmyzsh#8696) * git: make the gpristine alias remove untracked git repos (ohmyzsh#8697) * Use $jobstates and $jobtexts to look for jobs `jobs %string` doesn't work correctly when run inside `$()`. `$jobstates` and `$jobtexts` is available in the current shell process, so even though we need to replicate a bit more logic, every type of `fg` invocation works correctly. * lib: clean up termsupport.zsh * kube-ps1: update to latest upstream version (c685ac8) Closes ohmyzsh#8009 Co-authored-by: Jon Mosco <jonny.mosco@gmail.com> * knife: improve knife-solo support in completion (ohmyzsh#3315) Closes ohmyzsh#1944 Closes ohmyzsh#3315 * knife: fix refactor mistake * rbenv: fix rbenv_prompt_info prefix and suffix (ohmyzsh#3764) Closes ohmyzsh#3764 * arcanist: add functions which allow copy-pasting of URLS (ohmyzsh#8688) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * shrink-path: added glob and quote options (ohmyzsh#7694) * Added -g option to shrink-path plugin. The new optins adds an asterix to the uniquely shortened name, such that, if copy'n'pasted, zsh globbing will expand to the full path name of the shortened path: shrink-path -g: "/net/software/modules/modulefiles" -> "/n*/s*/modules/m*" shrink-path -l -g: "/net/software/modules/modulefiles" -> "/n*/s*/modules/modulefiles" * Updated also the README file with the new -g option. * shrink-path: improved handling of special cases This commits improves the handling of special cases in path strings: - handling of white space in path names - handling of single-letter path names * Update plugins/shrink-path/README.md Co-Authored-By: Jacob Tomaw <jacob.tomaw@gmail.com> * Fix typo "Asterix" and replace with "asterisk" * Add optional quoting support to shrink_path Co-authored-by: Jacob Tomaw <jacob.tomaw@gmail.com> * aws: add support for AWS CLI v2 autocompletion (ohmyzsh#8670) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * lib: support konsole* $TERM in title function (ohmyzsh#8035) * phing: fix copy-paste error in README * nvm: add `install-latest-npm` to completion (ohmyzsh#8709) * aws: fix awscli completion path on NixOS (ohmyzsh#8707) * gradle: use upstream completion and fix some other stuff Fixes ohmyzsh#6239 Fixes ohmyzsh#7946 Fixes ohmyzsh#8017 Fixes ohmyzsh#8717 Closes ohmyzsh#7987 Closes ohmyzsh#8718 * sdk: remove invalid value "candidates" from sdk flush completion (ohmyzsh#8725) * archlinux: fix wrong parameters in pacfiles alias (ohmyzsh#8712) * updater: use `git config` instead of `git -c` for git < v1.7.2 Fixes ohmyzsh#8732 * updater: use hardcoded color sequences instead of tput * z: add markdown Readme (ohmyzsh#8715) * Clean up plugin READMEs and a few plugins - fasd - history - mercurial - pylint - repo - yii2 * autoenv: look in additional installation locations, redo logic Fixes ohmyzsh#4681 Co-authored-by: Marc Cornellà <marc.cornella@live.com> * taskwarrior: update completion to latest version (dcdf712) Fixes ohmyzsh#8249 * man: use only first element of command before prepending man (ohmyzsh#8747) Co-authored-by: Michael Wurzer <michael.wurzer@sequality.at> Co-authored-by: Marc Cornellà <marc.cornella@live.com> * update path for snapd /snap/bin/* which is used by Linux systems (ohmyzsh#8752) Co-authored-by: mark horsfield <markhfromakron@gmail.com> * Add direnv plugin (ohmyzsh#8666) * direnv: change direnv to not assume path (ohmyzsh#8757) On Ubuntu, direnv is not installed in `/usr/local`. * virtualenvwrapper: look in $HOME/.local/bin directory (ohmyzsh#8758) * dotenv: add agree-once improvement to confirmation prompt (ohmyzsh#8729) * dotenv: add possibility to agree once for a given .env file * refactor: fix code style * Use :A modifier instead of readlink. Thanks Aloxaf * Use grep and clean up allowed list check logic * Simplify and reorder file; change default allowed list path * Add new feature to README * Make sure ZSH_CACHE_DIR is defined * Resolve symlinks in $PWD before storing in allowed list Co-authored-by: Aloxaf <bailong104@gmail.com> Co-authored-by: Marc Cornellà <marc.cornella@live.com> * themes: change lstheme function to themes in $ZSH_CUSTOM in any level Also sort and remove duplicates, and pipe to fmt to improve output format. Fixes ohmyzsh#8755 * history-substring-search: update to upstream version 2019-05-12 Updates OMZ's copy to commit 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb from zsh-users/zsh-history-substring-search * history-substring-search: fixing my dumb mistake * git: fix markdown in README (ohmyzsh#8769) * systemd: remove newline from systemd prompt (ohmyzsh#8772) * keychain: define SHORT_HOST if not defined Fixes problems when using the plugin via antibody or antigen. * nebirhos: use short hostname in prompt Fixes ohmyzsh#6050 * battery: fix Full battery bug on Linux; force 1-char-width on charging symbol * battery: remove printf usage where possible Spares us of the need to quote % symbols * colorized-man-pages: add hooks for dman and debman commands (ohmyzsh#8776) * colorized-man-pages: Added hooks for commands dman and debman `dman` and `debman` are tools from the package `debian-goodies` for Debian systems (see https://packages.debian.org/stable/debian-goodies). They can display man pages from manpages.debian.org or local debian packages respectively. README of the plugin is also updated. * Simplify syntax for future changes * Fix README syntax Co-authored-by: Marc Cornellà <marc.cornella@live.com> * gnu-utils: append make to cmds (ohmyzsh#8794) GNU "make" is installed as "gmake" by homebrew. * themes: fix minor syntax error * lib: speed up slow parts of the lib files; other small fixes * battery: revert battery charging symbol 1-character-width hack Fixes ohmyzsh#8804 * tig: add more info in README (ohmyzsh#8818) For more convenient plugin exploring. * composer: fix cdo alias due to command api change (ohmyzsh#8828) * meta: basic CODEOWNERS file (gitfast plugin) https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners * autojump: clarify need to install it first Related: ohmyzsh#8806 * jsontools: correct usage for is_json (ohmyzsh#8857) * aws: fix aws_change_access_key function with awscli v2 (ohmyzsh#8816) * sdk: improve sdkman completion (ohmyzsh#8854) * meta: add Ross Goldberg as owner of the sdk plugin * sdk: support completion of new commands in 5.8.0 (ohmyzsh#8870) * core: add basic Oh My Zsh CLI (ohmyzsh#8876) * core: move core folder to lib, for now * core: refresh zcompdump cache file in init script (ohmyzsh#8878) * core: fix cmp invocation in BSD systems BSD cmp doesn't have the option of reading from stdin, so use process substitution instead. * gitfast: proper synchronization (ohmyzsh#8550) * init: silence zcompdump metadata write for invalid ZSH_COMPDUMP filenames If `$SHORT_HOST` contains invalid filename characters, the compinit call doesn't error, but the zcompdump metadata write does. Use `tee` instead so we can silence the error. See ohmyzsh@dd1a726#commitcomment-38984764 * magic-enter: define bindkey for vi mode as well Closes ohmyzsh#8906 * pygmalion: revert multiline prompt change Fixes ohmyzsh#2317 Closes ohmyzsh#2321 * core: fix zstyle definition of use-cache * composer: use cache to fix slowness during startup Fixes ohmyzsh#6647 Closes ohmyzsh#6664 * composer: add aliases for 'outdated' commands Added `co` alias for `composer outdated` and `cod` for `composer outdated --direct` Closes ohmyzsh#5127 * composer: fix documented aliases * zsh-navigation-tools: update to 5937e57e Fixes ohmyzsh#8476 * Add plugin for rustup completion (ohmyzsh#8914) * core: enable hist_reduce_blanks Fixes ohmyzsh#8722 * update: display logo in rainbow colors (ohmyzsh#8941) * bundler: add alias for bundle check (ohmyzsh#5000) * bundler: add alias for bundle add Fixes ohmyzsh#8892 * update: fix bug in upgrade.sh: s/NORMAL/RESET/ (ohmyzsh#8947) * frontend-search: add packagephobia (ohmyzsh#8908) * Prefix cd calls with `builtin` (ohmyzsh#8937) * Revert "core: enable hist_reduce_blanks" This reverts commit cbd6fbe. Fixes ohmyzsh#8949 * pipenv: fix error when Pipfile is not a file (ohmyzsh#8931) * jira: add tempo command (ohmyzsh#8928) * git: exclude 'development' in gdba alias (ohmyzsh#8902) * core: remove inc_append_history option (ohmyzsh#8048) * man: look for man page for subcommands (ohmyzsh#8798) * af-magic: account for active conda envs in dash line See ohmyzsh#8081 (comment) * git: exclude devel branch from list in gbda alias (ohmyzsh#8957) * git: add convenience aliases for `git apply` and `git am` (ohmyzsh#8563) * forklift: add support for Forklift distributed via the Setapp (ohmyzsh#8803) * direnv: check if direnv is installed (ohmyzsh#8809) * fino-time: fix git and ruby prompt sequences Fixes ohmyzsh#8856 * git: clarify what the glp alias does (ohmyzsh#8850) * common-aliases: fix hardcoded .zshrc path (ohmyzsh#5926) * Use oh-my-zsh path variables in zshrc.zsh-template (ohmyzsh#8960) * avit: fix $reset_color sequence in prompt Fixes ohmyzsh#8952 * vagrant: fix vagrant box autocomplete (ohmyzsh#8929) * archlinux: fix pacweb with non-English locales (ohmyzsh#8916) * docker: update to latest upstream completion (92dc906) (ohmyzsh#8835) * git: add alias for git diff excluding lock files (ohmyzsh#8935) * asdf: fix completions if ASDF_DIR is already exported (ohmyzsh#8538) * rbenv: fix redirect in current_gemset Fixes ohmyzsh#8925 Related ohmyzsh#4688 * python: add line-number to pygrep (ohmyzsh#8867) * terraform: add fmt -recursive flag autocompletion (ohmyzsh#8880) * Add plugin for LXD autocomplete (ohmyzsh#7457) * Add plugin for bazel completion (ohmyzsh#6434) * Add `shell-proxy` plugin (ohmyzsh#8692) * kube-ps1: update to latest version (ede8098) Fixes ohmyzsh#8786 * brew: remove completion deprecation notice and fix README * jenv: fix Homebrew install path bug introduced in ohmyzsh#7541 * virtualenvwrapper: fix load and detection logic * Fix load of various plugins: fastfile, keychain, sfffe, stack * Remove git-remote-branch and nyan plugins (deprecated) * Add deprecation notice for fedora and go plugins. * init: use grep for zcompdump metadata check Closes ohmyzsh#8981 * init: oops * fino-time: fix virtualenv prompt by escaping dollar sign (ohmyzsh#8991) * init: reapply hack for invalid ZSH_COMPDUMP filenames (b876198) * web-search: add Wayback Archive (ohmyzsh#8784) * wd: update to latest version (ohmyzsh#8530) * lib: don't override bigger HISTSIZE and SAVEHIST values (ohmyzsh#8993) oh-my-zsh Changes the HISTSIZE and SAVEHIST values to fixed sizes, however if a bigger value is set in ~/.zshrc, it will override it, potentially causing the user history to be deleted. So, only set these values if no other is set and if it is lower than the default ones. * Silence non-existent/empty dir errors in fastfile_{sync,ls} * chucknorris: remove duplicate quotes Fixes ohmyzsh#8998 * chucknorris: fix typos (ohmyzsh#9012) * chucknorris: normalize apostrophes (ohmyzsh#9013) * peepcode: add virtualenv prompt and fix git calls * smt: fix time since last commit logic Fixes ohmyzsh#5244 * update: refactor and fix logic in check_for_upgrade.sh (ohmyzsh#8939) * web-search: allow custom search engines * web-search: add Google Scholar (ohmyzsh#9014) * muse: clean up theme * Change Discord invite URL * init: run update check in the same zsh process (ohmyzsh#9019) * osx: refactor plugin and add a few features (ohmyzsh#9026) Co-authored-by: Capybara <git.capybara@gmail.com> Co-authored-by: drootang <drootang@users.noreply.github.com> Co-authored-by: Augusto Souza <augustorsouza@gmail.com> Co-authored-by: PatrBal <44707588+PatrBal@users.noreply.github.com> * init: don't run update check if DISABLE_AUTO_UPDATE (ohmyzsh#9040) skip the update check at initialization if DISABLE_AUTO_UPDATE is set to true * Deprecate cloudapp plugin (fixes ohmyzsh#8966) * core: add title support for mlterm (ohmyzsh#8303) * archlinux: fix pacweb breaking when multiple packages found (ohmyzsh#9059) Co-authored-by: Magnus Boman <Kattus@users.noreply.github.com> * Add new mvn alias for `mvn fmt:format` (ohmyzsh#9053) * mvn: add mvnfmt alias * mvn: update README.md * update: only update on a valid affirmative input (ohmyzsh#9062) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * update: change dash in function name for sh compat (fixes ohmyzsh#9064) * Modernize install and update banners (ohmyzsh#9045) * encode64: fix typo in README (ohmyzsh#9052) * Handle unset variables in various parts of the codebase (ohmyzsh#8944) DISABLE_UNTRACKED_FILES_DIRTY, DISABLE_AUTO_TITLE, GIT_STATUS_IGNORE_SUBMODULES are not set Handle these variables not being set with conditional access. If the user has set -u option to report attempts to use undeclared / unassigned variable, accessing the variables needs to be conditional. * gradle: force `--console plain` for tasks cache generation (ohmyzsh#8731) Fixes ohmyzsh#8730 * install: fix typo (ohmyzsh#9069) Changing 'your' to 'you' * agnoster: fix git working tree check (ohmyzsh#9072) `git rev-parse --is-inside-work-tree` does not have a different exit code when not within a work tree; the difference is in the output, either "true" when in a work tree, or "false" when not. The if was modified similarly to the check for the hide-status config, which also parses command output rather than exit code. Co-authored-by: Kyle Laker <klaker@easydynamics.com> * lib: enable diff color (ohmyzsh#8807) * git: change main branch naming scheme (ohmyzsh#9049) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * cli: beauty touches on 'omz pr test' command * Bug and Feature Request Templates + MLH Theme + Readme (ohmyzsh#9068) Co-authored-by: Marc Cornellà <marc.cornella@live.com> Co-authored-by: Bartek Pacia <barpac02@gmail.com> * Edit for better consistency in template (ohmyzsh#8593) * sudo: make the behavior more in line with expectations (ohmyzsh#9047) * lib: prefix diff call with command to bypass diff aliases See ohmyzsh#8807 (comment) * lib: safety fix and speed-ups for git.zsh prompt functions (ohmyzsh#7804) * aws: allow @ in AWS profiles (ohmyzsh#9099) Fixes ohmyzsh#9060 by matching a `@` in the AWS profile name. * git: use `master` if it exists, otherwise use `main` See ohmyzsh#9049 (comment) Co-authored-by: Yufan You <ouuansteve@gmail.com> * mix-fast: add decriptions to mix-fast completions (ohmyzsh#8561) * feat(mix-fast): include desctiptions (ohmyzsh#8561) * feat(mix-fast): improve _mix_generate (no tail, better matching) * yarn: add alias for upgrade-interactive to the latest version (ohmyzsh#8764) * dotenv: add never option to confirmation prompt (ohmyzsh#9102) * git: better algorithm to decide what's the main branch Fixes ohmyzsh#9103 Co-authored-by: Yufan You <ouuansteve@gmail.com> * git: change docs for git_main_branch Also remove unnecesary dramatic remark * vscode: add support for VSCodium (ohmyzsh#9080) Co-authored-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> Co-authored-by: Marc Cornellà <marc.cornella@live.com> * Fix self check link * update: prefix rm call with command in trap (ohmyzsh#9107) * Suppress the problematic trap output in check_upg The newly added trap, in systems where `rm` is aliased to `rm="rm -v"`, shows a message stating that "update.lock" has been removed each time `zsh` is called. I simply suppressed it with directing the output to `/dev/null`. * Use `command` instead of >/dev/null to suppress * httpie: add alias for https (ohmyzsh#8032) * kubectl: add alias to list pods by namespace (ohmyzsh#8604) * docker-compose: add alias for `docker-compose kill` (ohmyzsh#8997) * timer: threshold to show timers only for time-consuming commands (ohmyzsh#8151) * git: go back to previous main branch detection logic Fixes ohmyzsh#9114 * extract: add IPA to extractable filetypes (ohmyzsh#9117) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * battery: add acpi requirement to README (ohmyzsh#9116) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * aws: improve check for aws_completer - unhardcode path (ohmyzsh#9123) Closes ohmyzsh#9122 The current check is assuming that the aws_completer is installed globally, it then runs the command without that path I have aws_completer in ~/.local/bin/aws_completer This changes the check to see if the command exists instead of concerning itself with where it in installed. This test matches the behavior of just running the command. * lib: support mlterm-256color Co-authored-by: Peter J. Schroeder <peterjschroeder@gmail.com> * rbenv: fix current_gemset Fixes ohmyzsh#8925 Co-authored-by: Josh Goodall <inopinatus@inopinatus.org> * colorize: add $ZSH_COLORIZE_CHROMA_FORMATTER config env var (ohmyzsh#8824) * pipenv: toggle pipenv shell on startup Fixes ohmyzsh#9136 * lib: substitute COMPLETION_WAITING_DOTS for ellipsis Closes ohmyzsh#8342 * Remove non-existing %p prompt sequence from themes Fixes ohmyzsh#8022 * pyenv: ignore $PATH pyenv if on WSL This solves the problem where the used pyenv is actually the one in a Windows folder, instead of in WSL. Fixes ohmyzsh#9034 * lib: bind keys to viins and vicmd keymaps and clean up file Fixes ohmyzsh#8468 * lib: add CTRL-backspace and CTRL-delete to delete whole words Fixes ohmyzsh#7609 Closes ohmyzsh#8191 Co-authored-by: Michal Grňo <m93a.cz@gmail.com> * lib: bind to all keymaps when COMPLETION_WAITING_DOTS is set Fixes ohmyzsh#9050 * cli: add update command (ohmyzsh#9094) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * wd: update to latest version mfaerevaag/wd@3d20d15 Fixes ohmyzsh#9002 * wd: fix permissions * lib: remove CTRL-Backspace binding for vi keymaps * meta: add ISSUE_TEMPLATE config.yml For now, it only adds a link to the Discord server. * lib: remove CTRL-Backspace key binding altogether It conflicts with normal Backspace behavior. Fixes ohmyzsh#9155 * Underline links in install and update script * Fix upgrade_oh_my_zsh function deprecation * Remove zsh session restart on omz update and upgrade_oh_my_zsh * meta: don't apply support label on bug reports Enough users have complained about the bug label not being applied instead. If there is no label applied this won't be complained about so often. * docs: add fetch install command for FreeBSD (ohmyzsh#9172) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * docs: document oneline argument passing to install script * Update README with new update command (ohmyzsh#9203) Note: `upgrade_oh_my_zsh` is deprecated. Use `omz update` instead. * sudo: keep space before the command to ignore it in the history (ohmyzsh#9178) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * zsh_reload: use $SHELL to reload zsh only if it's a zsh shell (fixes ohmyzsh#9054) * scd: update to 1.4.0 (ohmyzsh#9066) * vagrant-prompt: replace `grep -P` call with sed and clean up Fixes ohmyzsh#9207 * pygmalion: use pure zsh instead of perl (ohmyzsh#9210) My system doesn't have `perl` in $PATH, so using this theme clutters the shell output quite a bit. Turns out, the same thing can be accomplished in pure zsh (with extendedglob). Co-Authored-By: Marc Cornellà <marc.cornella@live.com> * chuck-norris: remove some CN quotes and fix formatting (ohmyzsh#9220) * Remove perl dependency * fishy: fix one-level directory bug and bad array assignment in zsh 5.0.1 * Add sponsor button * init: define $ZSH if not defined Closes ohmyzsh#9223 * lib: treat _ and - as part of a word Fixes ohmyzsh#8743 * common-aliases: lazily assign $BROWSER, $EDITOR and $XIVIEWER in ext aliases Fixes ohmyzsh#9212 * sublime: add Sublime Text 4 path for macOS Fixes ohmyzsh#9153 * fzf: setup FZF_DEFAULT_COMMAND based on installed tools (ohmyzsh#8895) Co-authored-by: Marc Cornellà <marc.cornella@live.com> * update: return git error code on failure (ohmyzsh#9238) Fixes ohmyzsh#9237 * wd: update to latest version (v0.5.0) (ohmyzsh#9244) * pyenv: run pyenv init with --no-rehash (ohmyzsh#8917) Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603 * meta: change feature label * meta: change support label * docs: fix small typo in README (ohmyzsh#9255) * brew: replace deprecated brew cask outdated command (ohmyzsh#9253) * Remove racially-charged language from the codebase The ZSH_THEME_RANDOM_BLACKLIST variable will be deprecated until it's removed 2 months from now. * docker: document option-stacking setting Fixes ohmyzsh#9266 * random: add ZSH_THEME_RANDOM_QUIET setting Fixes ohmyzsh#9180 Co-authored-by: James Eapen <jamespeapen@gmail.com> * avit: reenable use of $fg instead of prompt sequence colors to fix weird bug Fixes ohmyzsh#9232 * lib: clean up zsh_stats function * agnoster: allow disabling AWS prompt with SHOW_AWS_PROMPT=false Fixes ohmyzsh#8040 * laravel5: clean up * A few README tweaks * Right-align table in README * Fix image alignment * lib: correct :q syntax in title function for clarity * bgnotify: use $2 in preexec hook if $1 is empty Fixes ohmyzsh#5803 * brew: add alias for brew to avoid upgrading casks (ohmyzsh#9280) * lib: support alacritty $TERM in title function * composer: autoload cache functions Fixes ohmyzsh#9236 * lib: support simple terminal in title function Fixes ohmyzsh#9295 * minikube: fix spelling (ohmyzsh#9270) * terraform: add tf Alias (ohmyzsh#8206) * Remove redundant bashcompinit calls Fixes ohmyzsh#9246 * pip: move plugin cache to XDG folder (ohmyzsh#9299) Co-authored-by: Marc Cornellà <marc.cornella@live.com> Co-authored-by: Dan D'Avella <drdavella@gmail.com> Co-authored-by: Pavel Fokin <pavel.fokin@opensoftdev.ru> Co-authored-by: Pavel N. Krivitsky <pavel-github@krivitsky.name> Co-authored-by: Hielke Walinga <hielkewalinga@gmail.com> Co-authored-by: 0b10 <qbit8@protonmail.com> Co-authored-by: Andrea Nanni <37385837+ananni13@users.noreply.github.com> Co-authored-by: Matthew Manuel <matthew.manuel@biarri.com> Co-authored-by: RoToRx88 <spam@oij.fr> Co-authored-by: Josh Christopherson <josh.christopherson@stacksports.com> Co-authored-by: Marek Dědič <developer@dedic.eu> Co-authored-by: Jean-Yves Rivallan <jeanyves.rivallan@gmail.com> Co-authored-by: Jon Mosco <jonny.mosco@gmail.com> Co-authored-by: Masato Ikeda <masato.ikeda@gmail.com> Co-authored-by: chieping <takashi.honda.01@gmail.com> Co-authored-by: Alexey Györi <Alexey.gyoeri@gmail.com> Co-authored-by: Jacob Tomaw <jacob.tomaw@gmail.com> Co-authored-by: Nick Paterno <43416138+nicholasjpaterno@users.noreply.github.com> Co-authored-by: B YI <uuuuuu@protonmail.com> Co-authored-by: Ross Goldberg <rgoldberg@users.noreply.github.com> Co-authored-by: LuFan Zhong <lufanzhong@gmail.com> Co-authored-by: Christoph Bachhuber <cbachhuber89@gmail.com> Co-authored-by: Andrew Janke <andrew@apjanke.net> Co-authored-by: wurza <Wurzy96@gmail.com> Co-authored-by: Michael Wurzer <michael.wurzer@sequality.at> Co-authored-by: Mark <markh@cumulusnetworks.com> Co-authored-by: mark horsfield <markhfromakron@gmail.com> Co-authored-by: Moritz Schwörer <mr.mosch@gmail.com> Co-authored-by: Dan Rose <rotu@users.noreply.github.com> Co-authored-by: Hector S <hfsam88@gmail.com> Co-authored-by: Jędrzej Lewandowski <jedrzejblew@gmail.com> Co-authored-by: Aloxaf <bailong104@gmail.com> Co-authored-by: glechic <40598665+glechic@users.noreply.github.com> Co-authored-by: Jon <jon@mscreations.net> Co-authored-by: Felix Stupp <felix.stupp@outlook.com> Co-authored-by: Monson Shao <holymonson@gmail.com> Co-authored-by: schnatterer <schnatterer@users.noreply.github.com> Co-authored-by: Shahin Sorkh <sorkh.shahin@protonmail.com> Co-authored-by: Tapan Avasthi <tapan.k.avasthi@gmail.com> Co-authored-by: tom139 <tom139@users.noreply.github.com> Co-authored-by: Felipe Contreras <felipe.contreras@gmail.com> Co-authored-by: Michael Stucki <michael@stucki.io> Co-authored-by: Gilles <contact@gb-prod.fr> Co-authored-by: Raphaël Brulé <raphaelbrule22@gmail.com> Co-authored-by: Emanuel Alarcón <emanuel_cadems@hotmail.com> Co-authored-by: Roman Perepelitsa <roman.perepelitsa@gmail.com> Co-authored-by: Will Mendes <willmendesneto@gmail.com> Co-authored-by: Jacob Menke <jamenk@email.wm.edu> Co-authored-by: R Max Espinoza <me@rmax.io> Co-authored-by: Dmitry <32256512+shvimas@users.noreply.github.com> Co-authored-by: Mikael Andersson Wigander <mikael.grevsten@gmail.com> Co-authored-by: Benoit GALATI <benoit.galati@gmail.com> Co-authored-by: David <david@tecgia.com> Co-authored-by: larumbe <larumbe@users.noreply.github.com> Co-authored-by: Paul Rudkin <paul@rudkin.me.uk> Co-authored-by: Michael Klemm <michael.klemm@intel.com> Co-authored-by: Stanisław <rev1e@protonmail.com> Co-authored-by: Mohammad Saboorian <1073738+castedmo@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me> Co-authored-by: Kennith Leung <kennith.leung@gmail.com> Co-authored-by: Vinícius Picossi Teruel <vpteruel@gmail.com> Co-authored-by: Tvrtko Majstorović <tvrtkomaj@gmail.com> Co-authored-by: Albert Serrallé Ríos <aserrallerios@gmail.com> Co-authored-by: Mohammad <mohammad@gazelle.ai> Co-authored-by: Fotos Georgiadis <gfotos@gmail.com> Co-authored-by: Renato dos Santos <shazaum@gmail.com> Co-authored-by: Israel Rodrigo Faria <israel.faria@gmail.com> Co-authored-by: Septs <github@septs.pw> Co-authored-by: Yauhen <jsirex@gmail.com> Co-authored-by: Pierre Gimalac <pierre.gimalac@gmail.com> Co-authored-by: Marco Trevisan <mail@3v1n0.net> Co-authored-by: Sumit Sahrawat <sumitsahrawat@outlook.com> Co-authored-by: l3nn4rt <l3nn4rt@protonmail.com> Co-authored-by: Małgorzata Basińska <odmina@gmail.com> Co-authored-by: Capybara <git.capybara@gmail.com> Co-authored-by: drootang <drootang@users.noreply.github.com> Co-authored-by: Augusto Souza <augustorsouza@gmail.com> Co-authored-by: PatrBal <44707588+PatrBal@users.noreply.github.com> Co-authored-by: Ye Shu <chshu@protonmail.ch> Co-authored-by: joshuashaffer <joshua.shaffer@icmrl.net> Co-authored-by: Magnus Boman <6226312+kattjevfel@users.noreply.github.com> Co-authored-by: Magnus Boman <Kattus@users.noreply.github.com> Co-authored-by: Fatih Ergüven <fatih@erguven.org> Co-authored-by: alexagnelli <51273591+alexagnelli@users.noreply.github.com> Co-authored-by: Larson Carter <larsoncarter@blazermail.net> Co-authored-by: Hélio <insign@gmail.com> Co-authored-by: Patrick Moore <pat@finixpayments.com> Co-authored-by: Konstantin Gribov <grossws@gmail.com> Co-authored-by: Alex Zdanowicz <Zandwhich@users.noreply.github.com> Co-authored-by: Kyle Laker <kyle@laker.email> Co-authored-by: Kyle Laker <klaker@easydynamics.com> Co-authored-by: Adam Vandover <adam@vandover.me> Co-authored-by: Bartek Pacia <barpac02@gmail.com> Co-authored-by: Jethro Lee <dlemfh96@gmail.com> Co-authored-by: MDHD <MDHD.Yee@outlook.com> Co-authored-by: Robert Estelle <robertestelle@gmail.com> Co-authored-by: Lutz Horn <code@lhorn.de> Co-authored-by: Yufan You <ouuansteve@gmail.com> Co-authored-by: Veit Lehmann <levito@users.noreply.github.com> Co-authored-by: Emilien Escalle <neilime@users.noreply.github.com> Co-authored-by: Jakob Hellermann <jakob.hellermann@protonmail.com> Co-authored-by: Džiugas Eiva <dziugaseiva@gmail.com> Co-authored-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> Co-authored-by: M. Yas. Davoodeh <30480116+MYDavoodeh@users.noreply.github.com> Co-authored-by: Alexander Schaber <a.schaber@cuegee.com> Co-authored-by: Joaquín Moreira <joaquinscript@gmail.com> Co-authored-by: Piotr Zając <piotr.zajac@unixslayer.pl> Co-authored-by: Frederick Zhang <frederick888@tsundere.moe> Co-authored-by: Thi Doãn <t@thi.im> Co-authored-by: Samuel Terra <samuelterra22@hotmail.com> Co-authored-by: Amir Tahvildaran <amir@bizequity.com> Co-authored-by: Peter J. Schroeder <peterjschroeder@gmail.com> Co-authored-by: John Welsh <john.welsh@gmail.com> Co-authored-by: Michal Grňo <m93a.cz@gmail.com> Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> Co-authored-by: Adam G. Emerson <35545129+AdamGEmerson@users.noreply.github.com> Co-authored-by: Kirill Suslov <kirill.suslov@shopify.com> Co-authored-by: daddeffe <daddef@gmail.com> Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com> Co-authored-by: Florian Klink <flokli@flokli.de> Co-authored-by: Daniel Dugovic <dandydand@gmail.com> Co-authored-by: Alessandro Martini <alessandrofmartini@gmail.com> Co-authored-by: Lucas Larson <91468+LucasLarson@users.noreply.github.com> Co-authored-by: Atk <atk@aaathats3as.com> Co-authored-by: Randall Leeds <randall@bleeds.info> Co-authored-by: 0xflotus <0xflotus@gmail.com> Co-authored-by: Alessandro <alessandro.buonerba@ovoenergy.com> Co-authored-by: James Eapen <jamespeapen@gmail.com> Co-authored-by: Pierre-Luc Paour <github@paour.com> Co-authored-by: Olivier Lemasle <o.lemasle@gmail.com> Co-authored-by: Andrew Babichev <andrew.babichev@gmail.com> Co-authored-by: Goose <52642831+rekaerst@users.noreply.github.com>
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
Add --no-rehash to the pyenv init command, which was removed in [ohmyzsh#4492]. The rehash was likely disabled because it can affect shell startup times. It should only be necessary when installing or removing Python versions. See [pyenv/pyenv#784] and [sorin-ionescu/prezto#1603] for more detail. [ohmyzsh#4492]: ohmyzsh#4492 [pyenv/pyenv#784]: pyenv/pyenv#784 [sorin-ionescu/prezto#1603]: sorin-ionescu/prezto#1603
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