From 90f7b999ff064c99ad6f5eec015db82ac76d8429 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sun, 9 May 2021 20:16:35 +0300 Subject: [PATCH] ~/.*rc should be modified instead of ~/.*profile Otherwise, there's no effect for non-login interactive shells --- README.md | 7 ++----- bin/pyenv-virtualenv-init | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index be0e3f3..07d8558 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,17 @@ From inside that directory you can: 2. (OPTIONAL) **Add `pyenv virtualenv-init` to your shell** to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See "Activate virtualenv" below. ```sh - $ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile + $ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc ``` **Fish shell note**: Add this to your `~/.config/fish/config.fish` ```sh - status --is-interactive; and pyenv init - | source status --is-interactive; and pyenv virtualenv-init - | source ``` - **Zsh note**: Modify your `~/.zshenv` file instead of `~/.bash_profile`. + **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bashrc`. - **Pyenv note**: You may also need to add `eval "$(pyenv init -)"` to your profile if you haven't done so already. - 3. **Restart your shell to enable pyenv-virtualenv** ```sh diff --git a/bin/pyenv-virtualenv-init b/bin/pyenv-virtualenv-init index 765b8da..404ddde 100755 --- a/bin/pyenv-virtualenv-init +++ b/bin/pyenv-virtualenv-init @@ -50,7 +50,7 @@ fi if [ -z "$print" ]; then case "$shell" in bash ) - profile='~/.bash_profile' + profile='~/.bashrc' ;; zsh ) profile='~/.zshrc'