-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
direnv and venv segments #386
Comments
Update:
Still think this would be neat.
Alternatively, instead of segment-direnv wrapping segment-virtualenv etc., I could directly just use the available *env modules/segments. RIght now, $PWD comes with bold text. By doing the above, imagine if it were bold and coloured (to indicate direnv). What do you think? 😄 |
Not 100% sure of direnv, but I think the bug #387 being fixed here is at least adjacent to what your'e seeing. The issue with the I would be interested in seeing if you have the time or interest to test that fork and see if the same behavior exists or not. Edit: *fork, not actually forking, but the fork the PR is being made from 🦖 |
@elebertus, will give it a go and report back. EDIT: It works, thank you! |
Say I have this directory structure:
py-pandas/
py-pandas/.envrc
py-pandas/.direnv
py-pandas/.direnv/venv-de
venv-de is a directory created by running
python -m venv venv-de
from inside py-pandas.I'm using direnv, and have both direnv and venv modules in the powerline-go prompt.
When I cd into py-pandas, I see the direnv segment, and it activates the venv ok (confirmed by running
python -c "import sys;print(sys.prefix
). It prints<blabla>/py-pandas/.direnv/venv-de
.Then, from py-pandas directory, when I do
mv .direnv/venv-de .direnv/venv-do
, the venv segment magically shows up.Of course, by now the venv is "broken" and I'm not "in" it.
direnv and venv segments work ok in a faster machine (arch s390x)I have access to.
I should note that the above problem is on a zOS system (same architecture, different OS) that is quite slow (small).
So I wonder if there's a timing issue.
Both direnv and powerline-go updates the $PROMPT_COMMAND, and am using bash.
powerline-go sets it to
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
, but then direnv also updates this.When I issue
echo $PROMPT_COMMAND
(while the venv segment shows the venv's name, but I've renamed the venv directory underneath it), this is what it says -_update_ps1; _direnv_hook
.Anything I can do to make this work?
It would be amazing if the direnv segment automatically shows info about the activated env (be it python or whatever else), by wrapping over powerline-go's venv, etc.
Seeing just the directory name again is not adding much value (direnv segment).
Shell: bash
OS: zOS
Thanks for this excellent, excellent tool. I'm really enjoying it ❤️
The text was updated successfully, but these errors were encountered: