From 87e456d59cf43700c8ed257d957794d2c083082a Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Thu, 28 Oct 2021 11:32:59 -0700 Subject: spack setup-env.sh: make zsh loading async compatible, and ~10x faster (in some cases) (#26120) Currently spack is a bit of a bad actor as a zsh plugin, and it was my fault. The autoload and compinit should really be handled by the user, as was made abundantly clear when I found spack was doing completion initialization for *all* of my plugins due to a deferred setup that was getting messed up by it. Making this conditional took spack load time from 1.5 seconds (with module loading disabled) to 0.029 seconds. I can actually afford to load spack by default with this change in. Hopefully someday we'll do proper zsh completion support, but for now this helps a lot. * use zsh hist expansion in place of dirname * only run (bash)compinit if compdef/complete missing * add zsh compiled files to .gitignore * move changes to .in file, because spack --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index 712f02bb5f..68f83ea38d 100644 --- a/.gitignore +++ b/.gitignore @@ -210,6 +210,9 @@ tramp /eshell/history /eshell/lastdir +# zsh byte-compiled files +*.zwc + # elpa packages /elpa/ -- cgit v1.2.3-60-g2f50