spack/share/spack
Harmen Stoppels 6d030ba137
Deactivate previous env before activating new one (#25409)
* Deactivate previous env before activating new one

Currently on develop you can run `spack env activate` multiple times to switch
between environments, but they leave traces, even though Spack only supports
one active environment at a time.

Currently:

```console
$ spack env create a
$ spack env create b
$ spack env activate -p a
[a] $ spack env activate -p b
[b] [a] $ spack env activate -p b
[a] [b] [a] $ spack env activate -p a
[a] [b] [c] $ echo $MANPATH | tr ":" "\n"
/path/to/environments/a/.spack-env/view/share/man
/path/to/environments/a/.spack-env/view/man
/path/to/environments/b/.spack-env/view/share/man
/path/to/environments/b/.spack-env/view/man
```

This PR fixes that:

```console
$ spack env activate -p a
[a] $ spack env activate -p b
[b] $ spack env activate -p a
[a] $ echo $MANPATH | tr ":" "\n"
/path/to/environments/a/.spack-env/view/share/man
/path/to/environments/a/.spack-env/view/man
```
2021-10-28 11:39:25 -07:00
..
bash spack setup-env.sh: make zsh loading async compatible, and ~10x faster (in some cases) (#26120) 2021-10-28 11:32:59 -07:00
bootstrap/github-actions Bootstrap clingo from binaries (#22720) 2021-08-18 11:14:02 -07:00
csh copyrights: update all files with license headers for 2021 2021-01-02 12:12:00 -08:00
docker Build container images on Github Actions and push to multiple registries (#26247) 2021-09-30 23:34:47 +02:00
docs/docker/module-file-tutorial copyrights: update all files with license headers for 2021 2021-01-02 12:12:00 -08:00
gitlab E4S amd64 CI: add parsec (#26906) 2021-10-22 15:02:47 -06:00
keys update tutorial public key 2021-04-14 23:53:07 -07:00
logo add artisanal handcrafted SVG Spack logo. (#6165) 2017-11-06 22:42:16 -08:00
qa Deactivate previous env before activating new one (#25409) 2021-10-28 11:39:25 -07:00
templates containerize: pin the Spack version used in a container (#21910) 2021-10-25 13:09:27 -07:00
setup-env.csh Introduce a SPACK_PYTHON environment variable (#21222) 2021-02-12 10:52:44 -08:00
setup-env.fish setup-env: allow users to skip slow parts (#24545) 2021-07-08 17:07:26 +02:00
setup-env.sh spack setup-env.sh: make zsh loading async compatible, and ~10x faster (in some cases) (#26120) 2021-10-28 11:32:59 -07:00
setup-tutorial-env.sh Tab to spaces (#22362) 2021-03-18 06:20:06 +00:00
spack-completion.bash spack setup-env.sh: make zsh loading async compatible, and ~10x faster (in some cases) (#26120) 2021-10-28 11:32:59 -07:00