I use direnv v2.21.2 and want that the hook activates my previous created .venv. If I use just source .venv/bin/activate my environment gets activated, but PS1 reacts with an error message. I actually have no clue what to do with the PS1 variable but it seems not a big issue since I use starshipas my prompt. Not completly shure.
Using instead layout python3 works fine without error but creates the extra venv which I don't need. Any Ideas?
EDIT: The Error Message which is produced by direnv if unset PS1 is not used:
direnv: PS1 cannot be exported. For more information see https://github.com/direnv/direnv/wiki/PS1
The Message leads actually to the correct information, but doesn't help much about why the problem exist.
It seems
exportingPS1triggered a bug in Bash 3.0, and direnv did not have a way tosetcertain variable instead ofexporting them. I don't know what bug in Bash was triggered exactly.Interesting. I have another variable [like CDPATH –ed] that would best be set instead of exported: PS1. Direnv doesn't really have a mechanism for that. If I get around to rewrite direnv I will take that into account. — zimbatm commented on issue 251 on Mar 11, 2017
PS1 is on the direnv blacklist because of a bug in bash 3.x — zimbatm commented on issue 331 on Feb 20, 2018
// PS1 should not be exported, fixes problem in bash — comment in env_diff.go