Repository navigation
Conversation
`vp env setup` will select the `env.nu` syntax from the Nushell version. VP_NU_VERSION gives that version directly, so `vp env setup` does not run `nu`. Tests use it to make the generated `env.nu` independent of the installed Nushell.
Nushell resolves command names at parse time, and it parses the Vite+ env.nu after the user's config. A user command with the name of a built-in, such as `def update []`, replaced the built-in that env.nu calls, and Nushell stopped at startup with `nu::parser::extra_positional`. env.nu now calls each built-in that a user can shadow with the `%` sigil, and calls `fish` as `^fish`. Nushell 0.112.1 added the sigil, and earlier versions cannot parse it. Thus, `vp env setup` asks the `nu` on PATH for its version and writes the sigils only for 0.112.1 or later. In other cases, it writes the same env.nu as before. Fixes voidzero-dev#3092
Recommend Nushell 0.112.1 or later, and tell users with an earlier version to run `vp env setup` again after they upgrade Nushell.
`vp env setup` waited for `nu -c "version | get version"` without a limit. A `nu` that did not answer stopped `vp env setup`. Stop the check after 5 seconds, kill `nu`, and write the env.nu without the `%` sigil. Also cite the Nushell 0.112.1 release notes for the version that added the `%` sigil.
`vp env setup` selects the env.nu syntax from the `nu` on PATH. A Nushell earlier than 0.112.1 cannot parse an env.nu written for a later version, so tell users with more than one installation to use the same `nu`.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7012acdb3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`nu --version` prints the same bare version as `nu -c "version | get version"`, but it exits before the engine starts. Thus, the user's config, autoload files, and plugins cannot affect the check, and the check is faster.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Context
If a Nushell user defines a custom command with the same name as a built-in command such as
update, for exampledef update [], Nushell does not start. Nushell resolves command names at parse time, and it reads the Vite+env.nuafter the user's configuration. Thus, theupdatecall inenv.nuresolves to the user's command. The arguments do not match, and Nushell stops at startup withnu::parser::extra_positional.To prevent this,
env.nunow calls each built-in command with the%sigil, for example%update. With the sigil, Nushell runs the built-in command even if a custom command has the same name.Nushell 0.112.1 added the
%sigil, as the release notes state, and earlier versions cannot parse it. Thus,vp env setupnow checks the version of thenuonPATHand adds the sigil only for 0.112.1 or later. For an earlier version, it writes the sameenv.nuas before this change. Users of an earlier version who shadow these commands still cannot start Nushell until they upgrade Nushell and runvp env setupagain. The documentation now describes this procedure.