1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 17:25:23 +02:00

[direnv] compatibility for zsh & bash fixed, SHELL give the default shell, not the current shell)

This commit is contained in:
Hyacinthe Cartiaux 2020-05-13 18:55:50 +02:00
parent a3c773c95b
commit 3880062e95

View file

@ -2,7 +2,8 @@
# See https://direnv.net/ # See https://direnv.net/
if [ -n "$(which direnv 2>/dev/null)" ]; then if [ -n "$(which direnv 2>/dev/null)" ]; then
eval "$(direnv hook $(basename $SHELL))" current_shell=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}')
eval "$(direnv hook $(basename $current_shell))" | true
# See https://github.com/direnv/direnv/wiki/Python#restoring-the-ps # See https://github.com/direnv/direnv/wiki/Python#restoring-the-ps
show_virtual_env() { show_virtual_env() {