-
Notifications
You must be signed in to change notification settings - Fork 589
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
Added conda env segment #24
base: master
Are you sure you want to change the base?
Conversation
I guess you also need to add
to |
agnoster.zsh-theme
Outdated
env=$VIRTUAL_ENV | ||
fi | ||
|
||
if [[ -n $CONDA_DEFAULT_ENV ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not check this first and then use elif
to explicitly fall back? This will make sure that this is the first choice if changes are made in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelAquilina I assume you're right. As this is not my PR I cannot say for sure. But it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean something like this?
if [[ -n $CONDA_DEFAULT_ENV ]]; then
env=$CONDA_DEFAULT_ENV
elif [[ -n $VIRTUAL_ENV ]]; then
env=$VIRTUAL_ENV
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes :) @Gigitsu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, its good practice to wrap your variables in quotes, otherwise spaces might give you wrong results:
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
env="$CONDA_DEFAULT_ENV"
elif [[ -n "$VIRTUAL_ENV" ]]; then
env="$VIRTUAL_ENV"
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it make sense to me too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelAquilina thank you for the advices, I've made the changes and updated the pull request
@drorata thank you for your interest. I don't thinks it is necessary to set |
@Gigitsu I had to disable |
@drorata what behaviour do you have with |
I can confirm that also on another system I had to disable |
See agnoster/agnoster-zsh-theme#24 for more details
if [[ -n $VIRTUAL_ENV ]]; then | ||
local env=''; | ||
|
||
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. But probably worth adding a comment explaining why this code exists :)
agnoster.zsh-theme
Outdated
fi | ||
} | ||
|
||
prompt_kubecontext() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubernetes is unrelated to conda. Want to break this out to a separate PR?
If y'all are interested, I added support for this over on my AgnosterJ fork. |
Same here. I mean this modification takes no influence on the on the BTW, I would be very happy to get this merged and integrated (if the requested changes could be made). |
Ok, I've created another pull request ( #148 ) for k8s context, do you prefer a new pr for this to or can I just modify this? |
Anything happening here? :) |
Can this go in please? |
Ditto |
Hi @MichaelAquilina, can I do something to get this PR approved? If not, we can go ahead and close it. |
@Gigitsu thanks for the work. It works perfectly in my system. I dont understand why its not merged yet. I had to use your fork. Here I have attached a screenshot. |
No description provided.