2

my .bashrc has these lines at the bottom:

if [ -f $HOME/tools/bashrc ]; then
        source $HOME/tools/bashrc
fi

and $HOME/tools/bashrc has this code at the bottom:

eval "$(pyenv init -)"
pyenv virtualenvwrapper_lazy
eval "$(direnv hook bash)"
export DIRENV_LOG_FORMAT=

but when I access directories that contain .envrc, it's not reading it. I even tried to add echo just above the eval "$(direnv hook bash)" and it's echoing the text ok upon login or opening a new bash.

One interesting thing is this: When I access a directory that has .envrc in it, then run tmux new -s <name>, it will open a new bash and read the .envrc. But when I access another directory that has .envrc on that same tmux session, still does read it.

The only way for me to make it work is by manually typing eval "$(direnv hook bash)" upon login, which not ideal.

I even tried hardcoding everything at the bottom of ~/.bashrc but still the same behavior. Is anyone has an idea? Thanks!

Noel Pure
  • 121
  • 4

0 Answers0