-
Notifications
You must be signed in to change notification settings - Fork 364
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
Nushell hotfix #2841
Nushell hotfix #2841
Conversation
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.
I haven't checked that locally, does it work as intended for you?
{ | ||
fs::create_directories(sh_source_path.parent_path()); | ||
} | ||
catch (...) |
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.
Catch the correct exception, at least std::exception
} | ||
catch (...) | ||
{ | ||
} |
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.
Maybe log, or let the exception break the current flow?
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.
I just pushed a comment to this part. Does this suffice?
@AntoinePrv Yes. The originally implementation unset the path variable to empty string which caused some obvious issues for me when deactivating. I see that the current PR is entangled with the other PR I will fix that and look at the review above. |
f93616c
to
adc68be
Compare
I don't understand the practice with As an implementation |
I'm just following the example listed above. In essence we can remove the entire section since the activation does not generate any files. EDIT: this is also not the core of the current PR. The part being commented on was already merged before. |
e7bc55d
to
93f95bb
Compare
This works great on my machine (deactivation works as expected); however, I did end up commenting out the prompt modification in # # update prompt
# if ($env.CONDA_PROMPT_MODIFIER? != null) {
# $env.PROMPT_COMMAND = {|| $env.CONDA_PROMPT_MODIFIER + (create_left_prompt)}
# } # # update prompt
# $env.PROMPT_COMMAND = {|| create_left_prompt} I am using Starship, which already picks up on an activated environment and uses the following to inject the prompt: mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu source ~/.cache/starship/init.nu so it might just be an issue of a nonstandard config |
@zacharyburnett ah I was afraid of that happening to someone. I haven't figured out a good way to extend a closure. Starship seems to additionally override it (see here), implying it is no straightforward (embedded way to do it). I will give this some thought. |
93f95bb
to
469421e
Compare
@zacharyburnett can you checkout the latest push. I believe this may be compatible with starship, and other future prompts. |
I reran |
That is good to hear ;-) |
Can this be merged @AntoinePrv? |
469421e
to
37cb377
Compare
Please excuse me for not being very responsive, I'm not very knowledgeable with Nushell. For the prompt, I was never a big fan of Conda modifying the prompt, but it did not matter since advanced bash/zsh prompts are set through |
No worries. I guess nobody is very knowledgeable about Nu since it is
rather new. I have currently set it up such that the PROMPT_COMMAND is
stored and modified inplace.Since starship is setting the prompt command
with a new closure, the proposed method here works if the micromamba is at
the end of the chain. Perhaps this should be added in the docs somewhere.
…On Tue, 17 Oct 2023 at 10:52, Antoine Prouvost ***@***.***> wrote:
Please excuse me for not being very responsive, I'm not very knowledgeable
with Nushell.
If it works for both of you, I guess we can merge (waiting for CI once
more).
For the prompt, I was never a big fan of Conda modifying the prompt, but
it did not matter since advanced bash/zsh prompts are set through
PROMPT_COMMAND.
If you want to leave the prompt out of the activation script here, that is
also fine. Since Nushell is more powerusers, I expect users like to set
their own prompts.
—
Reply to this email directly, view it on GitHub
<#2841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEUVDV4PDJVA5KGJKVBRLEDX7ZBOVAVCNFSM6AAAAAA4ZY3JLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVHE3DQNBSGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
- Checkout my website <https://cvanelteren.github.io/> for contact info
and current projects!
|
Noticed the deactivation was not working properly. This is fixed now.
This is the same as #2840 but using the correct main as base. It extends #2693.