Skip to content
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

fix(init): Change Nushell init for nu 0.60 #3773

Merged
merged 3 commits into from Mar 24, 2022
Merged

Conversation

davidkna
Copy link
Member

@davidkna davidkna commented Mar 20, 2022

Description

This PR updates the nu init for the upcoming v0.60 release. directories-next is also replaced by dirs-next again to match nushell behavior.

Motivation and Context

Closes #1716
Closes #3526

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@davidkna davidkna marked this pull request as ready for review March 22, 2022 22:00
@davidkna
Copy link
Member Author

Nushell 0.60 has been released!

@jfchevrette
Copy link

I just tried these new instructions on macOS but they do not work as the config file is read from ~/Library/Application Support/nushell/config.nu and nushell will not use ~/.config/nushell/config.nu

@jfchevrette
Copy link

jfchevrette commented Mar 23, 2022

It might be worth checking issue nushell/nushell#4773 which was opened for zoxide but I believe will apply to starship and the updated instructions from this PR

The TLDR is that the save would happen at "eval time" and the source would happen at "sourcing" time and that's a nu language design decision

ref.: https://www.nushell.sh/book/thinking_in_nushell.html#parsing-and-evaluation-are-different-stages

@davidkna
Copy link
Member Author

@jfchevrette Thanks for the suggestions.

@Decodetalkers
Copy link

def starship_prompt [] {
    # jobs are not supported
    # status is not supported
    starship prompt --cmd-duration $env.CMD_DURATION_MS
}
let-env PROMPT_COMMAND = { (starship_prompt) }

Maybe you can try this one?

@davidkna
Copy link
Member Author

@chen244 Given the high likelihood of future changes to the shell, I would rather avoid that.

@matchai matchai merged commit c9b75fe into starship:master Mar 24, 2022
README.md Show resolved Hide resolved
@sophiajt
Copy link

@matchai - thanks for working on this fix. I made a comment about Nushell's parser/evaluator separation. For that init step, since it won't run before the source on the next line you'll need to run it as a separate step first before starting up the config.

@davidkna davidkna deleted the nu branch March 24, 2022 19:28
@fdncred
Copy link

fdncred commented Mar 24, 2022

$env.LAST_EXIT_CODE is also supported in nushell now.

@sophiajt
Copy link

@davidkna - oops, I should have tagged you for ^

@davidkna
Copy link
Member Author

$env.LAST_EXIT_CODE is also supported in nushell now.

This is part of the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Starship fails when %USERPROFILE% is changed Nu shell doesn't support showing status of last command
6 participants