GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(env): call Nushell built-ins with the % sigil in env.nu by naokihaba · Pull Request #3123 · voidzero-dev/vite-plus

Conversation

@naokihaba

@naokihaba naokihaba commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Context

  • resolves: Nushell env bug: Positional completer input deprecated #3092

If a Nushell user defines a custom command with the same name as a built-in command such as update, for example def update [], Nushell does not start. Nushell resolves command names at parse time, and it reads the Vite+ env.nu after the user's configuration. Thus, the update call in env.nu resolves to the user's command. The arguments do not match, and Nushell stops at startup with nu::parser::extra_positional.

To prevent this, env.nu now 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 setup now checks the version of the nu on PATH and adds the sigil only for 0.112.1 or later. For an earlier version, it writes the same env.nu as before this change. Users of an earlier version who shadow these commands still cannot start Nushell until they upgrade Nushell and run vp env setup again. The documentation now describes this procedure.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fengmk2 and chatgpt-codex-connector[bot] reacted with thumbs up emoji jong-kyung reacted with heart emoji
All reactions
  • 👍 2 reactions
  • ❤️ 1 reaction
naokihaba added 5 commits October 19, 2026 22:37
@naokihaba
feat(env): add VP_NU_VERSION to set the Nushell version for env setup
96bd580
`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.
@naokihaba
fix(env): call Nushell built-ins with the % sigil in env.nu
4192d2a
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
@naokihaba
docs(env): document the Nushell version requirement
48034d4
Recommend Nushell 0.112.1 or later, and tell users with an earlier version
to run `vp env setup` again after they upgrade Nushell.
@naokihaba
fix(env): stop the Nushell version check after a timeout
e928845
`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.
@naokihaba
docs(env): explain Nushell version mismatch between setup and startup
4b1c88e
`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`.
@naokihaba naokihaba self-assigned this Oct 19, 2026
@naokihaba
Merge branch 'main' into fix/nushell-env-builtin-shadowing
7012acd
@naokihaba

naokihaba commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T15:20:05.084613Z 16bf332 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 19, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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.

💡 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/vp_global_cli/src/commands/env/setup.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@naokihaba
naokihaba marked this pull request as ready for review October 19, 2026 14:12
@naokihaba
naokihaba requested review from fengmk2 and nekomoyi October 19, 2026 14:12
fengmk2
fengmk2 approved these changes Oct 19, 2026
View reviewed changes
nekomoyi
nekomoyi approved these changes Oct 19, 2026
View reviewed changes
Comment thread crates/vp_global_cli/src/commands/env/setup.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@naokihaba
perf(env): read the Nushell version with nu --version
8ba135b
`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.
@naokihaba

naokihaba commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@naokihaba
Merge branch 'main' into fix/nushell-env-builtin-shadowing
16bf332
@naokihaba
naokihaba marked this pull request as draft October 19, 2026 15:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 16bf332f2d

ℹ️ 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".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@naokihaba
naokihaba marked this pull request as ready for review October 19, 2026 16:21
naokihaba added 2 commits October 20, 2026 01:22
@naokihaba
Merge branch 'main' into fix/nushell-env-builtin-shadowing
b7fd2af
@naokihaba
ci: retrigger CI after macOS snapshot install timeouts
3adf114
@naokihaba naokihaba mentioned this pull request Oct 19, 2026
Nushell completers in env.nu use the deprecated positional completer input #3127
Closed
4 tasks done
@fengmk2
fengmk2 merged commit e176533 into voidzero-dev:main Oct 20, 2026
77 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 mentioned this pull request Oct 22, 2026
release: v1.4.0 #3201
Merged
fengmk2 added a commit that referenced this pull request Oct 23, 2026
@voidzero-guard @fengmk2 @claude
release: v1.4.0 (#3201)
102fe8e
Vite+ 1.4 runs TypeScript and JavaScript files with `vpx`, and `vp
migrate` can move tsx scripts to it. It also adds `vp check
--deny-warnings` and `vp pm team`, and installs the global CLI's
dependencies from a lockfile published with each release.

### Features

- `vpx <file>` runs a TypeScript or JavaScript file on the project's
Node.js with the [oxc-node](https://github.com/oxc-project/oxc-node)
loader that ships with Vite+, and `vpx --watch <file>` reruns it when a
file it uses changes. In `package.json` scripts, the `vpx` bin of the
`vite-plus` package runs scripts without the global CLI and runs package
binaries only from `node_modules/.bin`, pointing to `vp dlx` for
anything not installed
([docs](https://viteplus.dev/guide/vpx#running-scripts))
([#2936](#2936),
[#3164](#3164)), by
@Brooooooklyn and @fengmk2.
- `vp migrate` offers to move tsx scripts to `vpx`: `tsx a.ts`, `npx tsx
a.ts`, `node --import tsx a.ts`, and `tsx watch a.ts` in `package.json`
scripts, lint-staged tasks, and `#!/usr/bin/env tsx` shebangs become
`vpx a.ts` or `vpx --watch a.ts`. A project already on Vite+ gets the
offer with `vp migrate --full`
([docs](https://viteplus.dev/guide/migrate-rules#tsx-to-vpx))
([#3179](#3179)), by
@fengmk2.
- `vp check --deny-warnings` fails the check on lint warnings, so CI no
longer needs a separate `vp lint --deny-warnings` run
([docs](https://viteplus.dev/guide/check#usage))
([#3075](#3075)), by
@acalvino4.
- `vp pm team` creates and destroys registry organization teams and
adds, removes, and lists their members, through npm or pnpm 11.13.0 and
later, falling back to npm for older pnpm and Bun
([#3040](#3040)), by
@jong-kyung.
- Security: `vp` no longer accepts HTTPS certificates issued through the
distrusted emSign intermediates when downloading Node.js, package
managers, and upgrades
([RUSTSEC-2026-0382](https://rustsec.org/advisories/RUSTSEC-2026-0382.html),
[RUSTSEC-2026-0383](https://rustsec.org/advisories/RUSTSEC-2026-0383.html)),
and it ships tokio 1.54.1, which fixes a race in `tokio::time::Interval`
([RUSTSEC-2026-0384](https://rustsec.org/advisories/RUSTSEC-2026-0384))
([#3159](#3159),
[#3202](#3202)), by
@wan9chi and @fengmk2.
- `vp pm` registry commands (`login`, `logout`, `whoami`, `owner`,
`token`, `dist-tag`, `deprecate`, `search`, `ping`, and `publish`) run
pnpm's own commands on pnpm 11 and later (`token` from 12.13.0), and `vp
pm owner` and `vp pm publish` run Yarn's own commands, so they follow
that package manager's registry configuration and authentication. Older
versions still go through npm
([#3044](#3044)), by
@jong-kyung.
- The installer and `vp upgrade` install the global CLI's JavaScript
dependencies from a lockfile published with each release, so every
installation of a version gets the same dependency versions. Set
`VP_SETUP_SKIP_INSTALL_LOCKFILE=1` to resolve them again if that
installation fails
([docs](https://viteplus.dev/guide/global-cli#vp-setup-skip-install-lockfile))
([#3117](#3117)), by
@fengmk2.
- Upgrade the bundled tools
([#3133](#3133),
[#3158](#3158),
[#3175](#3175)), by
@voidzero-guard[bot] and @fengmk2:
- `[email protected]` to `[email protected]`, with fixes for bundled dev mode, chunk
import maps, CSS `url()` values containing `%`, and subpath imports with
several `#` characters.
- `[email protected]` to `[email protected]`, with fixes for `this.resolve`
recursion between plugins using `skipSelf: true`, strict execution
order, and chunk import maps.
- `[email protected]` to `[email protected]`, with rule fixes that report cases
missed before, for example in `prefer-const`, `no-param-reassign`, and
`sort-imports`.
- `[email protected]` to `[email protected]`, with formatting fixes for comments,
parentheses, JSDoc, JSON, YAML, and Markdown.
- The new oxlint and oxfmt versions can flag code that passed before. If
your CI runs `vp check`, run `vp fmt` after upgrading.
  - `vpx` scripts run on `[email protected]`.
- `@vitejs/devtools` 0.8 is accepted as a peer dependency, alongside
0.7.

### Fixes & Enhancements

- The standalone `vp` executable is 30%+ smaller
([#3086](#3086)), by
@fengmk2.
- `VP_SETUP_NODE_VERSION` selects the Node.js version the installer uses
for the CLI's dependencies, so `setup-vp` can use the project's version
and avoid downloading a second Node.js in CI
([docs](https://viteplus.dev/guide/global-cli#vp-setup-node-version))
([#3087](#3087)), by
@fengmk2.
- When tasks miss the cache, `vp run` finishes sooner because it no
longer waits for the disk after saving each result. If the computer
loses power or the operating system crashes during a run, the entries it
saved can be lost and those tasks run again
([vite-task#871](voidzero-dev/vite-task#871)),
by @magurotuna.
- Cached tasks no longer miss the cache when only pnpm's
`node_modules/.modules.yaml` differs, for example after installing with
another pnpm version, with `--ignore-scripts`, or on glibc and musl
machines
([vite-task#850](voidzero-dev/vite-task#850)),
by @wan9chi.
- `vp run` in a package that sits inside a workspace folder but is not
listed in its `pnpm-workspace.yaml` `packages` or `package.json`
`workspaces` runs that package's own tasks with its own
`packageManager`, instead of treating the enclosing workspace as its
root
([vite-task#859](voidzero-dev/vite-task#859)),
by @liangmiQwQ.
- A mistyped or misplaced task setting fails with an error that names
it, such as `unknown field outputs`, instead of `data did not match any
variant of untagged enum UserTaskDefinition`
([vite-task#815](voidzero-dev/vite-task#815)),
by @tlq5l.
- `vp run` no longer panics on scripts that contain non-ASCII
characters, such as `echo こんにちは`, and no longer cuts those commands off
in its output
([vite-task#861](voidzero-dev/vite-task#861)),
by @magurotuna.
- In cached tasks on Linux and macOS, programs that pass `-1` as a
directory descriptor, such as `ps -p <pid>` from procps-ng 4.0.6 and
later, no longer abort
([vite-task#862](voidzero-dev/vite-task#862)),
by @magurotuna.
- On Linux, cached tasks such as `pnpm dlx` no longer occasionally abort
with a stack overflow when the program makes concurrent system calls at
startup
([vite-task#854](voidzero-dev/vite-task#854)),
by @fengmk2.
- On Windows, `vp run` and the global `vpx` wait for the child process
to finish its Ctrl+C cleanup and exit with its code, instead of exiting
immediately
([#3167](#3167)), by
@fengmk2.
- `vp migrate` and the `prefer-vite-plus-imports` lint autofix leave
`vite/rolldown` and `vite/rolldown/*` imports unchanged, instead of
rewriting them to `vite-plus/rolldown` subpaths that `vite-plus` does
not export
([#3070](#3070),
[#3191](#3191)), by
@Crimson341 and @Dunqing.
- `vp migrate` keeps existing `.nvmrc` files instead of converting them
to `.node-version`, so nvm, fnm, and other tools that read `.nvmrc` keep
working and the selected Node.js version does not change
([#3126](#3126)), by
@liangmiQwQ.
- `vp migrate` converts Oxlint configs that `extends` shared JSON files
into TypeScript modules imported through `lint.extends`, so the
inherited rules keep applying after migration
([#3097](#3097)), by
@fengmk2.
- `vp migrate` skips the git hooks prompt when the project's Vite+ hooks
are already set up, and completes a partial setup without prompting
([#3118](#3118)), by
@0froq.
- `vp migrate` keeps the workspace members declared in `package.json`
`workspaces` when it selects pnpm for a project without a lockfile, so
recursive commands still include them
([#2863](#2863)), by
@SaKaNa-Y.
- `vp migrate` no longer reports `unawaited-assertion` for a local
assertion promise that the function later awaits or returns
([#3180](#3180)), by
@fengmk2.
- `pnpm create vite-plus` and `yarn create vite-plus` no longer fail
during dependency installation when `vp` is not on `PATH`, and no longer
run a different global `vp` version for installation, formatting, and
hooks ([#3181](#3181)), by
@fengmk2.
- `vp create` and `vp migrate` resolve the npm registry and credentials
as npm does: a `.npmrc` above the project is no longer read,
`userconfig` and `globalconfig` are honored, and registry hosts in
credential keys match regardless of case
([#3124](#3124)), by
@liangmiQwQ.
- `vp pack` and `vp create` find the monorepo root the same way as `vp
run` and `vp install`, and `vp pack` at a monorepo root without a
`vite.config` no longer picks up a config from the directory above
([#3101](#3101)), by
@liangmiQwQ.
- `defineConfig` keeps plugins that are promises unchanged, so plugins
that find themselves through properties on their promise, such as
`vike()`, work under Vite+
([#3154](#3154)), by
@liangmiQwQ.
- `vp dev` with `experimental.bundledDev` no longer fails with
`ERR_MODULE_NOT_FOUND` when no separate `rolldown` package is installed,
and no longer picks up the runtime of an unrelated installed `rolldown`
([#3111](#3111)), by
@fengmk2.
- With `nodeShimMode: system_first`, `vp node` and `vp env exec` run the
system tool that the shell would find, instead of downloading and
running the managed Node.js
([#3100](#3100)), by
@liangmiQwQ.
- `VP_NODE_VERSION=22` and other partial versions resolve to an exact
release in `vp env install`, `vp env exec`, and `vp env clean`, instead
of failing with a 404 download error
([#3038](#3038)), by
@Dev-next-gen.
- `vp env pin` and `vp env unpin` show the file and field they changed.
Package-manager pins from a workspace member update the workspace root
`package.json`, and the help and guide now say so
([#3103](#3103)), by
@SaKaNa-Y.
- In PowerShell, a bare `--` reaches `vp` again, so `vp create vite --
--template react-ts` forwards `--template` to create-vite
([#3083](#3083)), by
@fengmk2.
- Nushell 0.112.1 and later starts when the user defines a custom
command with the same name as a built-in that the Vite+ `env.nu` calls,
such as `update`. Run `vp env setup` again to regenerate `env.nu`
([#3123](#3123)), by
@naokihaba.
- Package-manager commands reject options that the selected version
would silently ignore, such as `--dry-run` or `--provenance` with an npm
whose version is unknown, instead of running without them
([#3122](#3122)), by
@jong-kyung.
- Fresh Bun installs verify the integrity hash in a `packageManager` pin
and reject a mismatched download, as pnpm 12 and later already did
([#3134](#3134)), by
@jong-kyung.
- A failed `vp install -g` restores the executables and npm links that
existed before, instead of deleting files it never created
([#3119](#3119)), by
@jong-kyung.
- `vp install -g` skips package binaries with unsafe names or targets
instead of linking them, as pnpm does
([#3156](#3156)), by
@jong-kyung.
- `npm uninstall -g <package> --dry-run` no longer removes the package's
commands from Vite+
([#3112](#3112)), by
@jong-kyung.

### Refactor

- Replace `glob` with `tinyglobby` in the CLI and share `.nvmrc` line
parsing between reading and pinning. Workspace discovery in `vp create`
and `vp migrate` now honors negated patterns such as `!packages/foo` and
follows symlinked directories in `**` patterns, as pnpm does
([#3099](#3099),
[#3125](#3125)), by
@liangmiQwQ.
- Share clap error diagnostics, manager preference parsing, external
tool lookup, and native shell parsing for migration rewrites, and remove
a redundant git hooks wrapper
([#3172](#3172),
[#3143](#3143),
[#3138](#3138),
[#3173](#3173)), by
@jong-kyung, @myuron, and @fengmk2.

### Docs

- Note that `run.cache` can only be set in the workspace root's
`vite.config.ts`
([#3139](#3139)), by
@yusuke99.

### Chore

- Bump vite-task to `a3c087a`; its user-facing changes are listed above
([#3153](#3153),
[#3168](#3168),
[#3184](#3184)), by
@wan9chi.
- Run Node.js, runtime download, and package-manager tests against local
mirrors and offline fixtures, serve snapshot registry traffic from local
fixtures and a shared cache, replace sleeps with deterministic waits,
keep snapshot setup off the npm registry, and fix or remove tests that
checked nothing
([#3067](#3067),
[#3169](#3169),
[#3170](#3170),
[#3171](#3171),
[#3144](#3144),
[#3146](#3146),
[#3145](#3145),
[#3147](#3147),
[#3148](#3148),
[#3194](#3194),
[#3203](#3203)), by
@fengmk2 and @liangmiQwQ.
- Cover package-manager detection for nested projects and owner listing
with pnpm 11.28.7, and allow time for the Playwright type check on slow
runners ([#3051](#3051),
[#3174](#3174),
[#3082](#3082)), by
@liangmiQwQ, @jong-kyung, and @fengmk2.
- Update the Node.js versions used for development, CI, and release
publishing to the [October 2026 security
releases](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases):
22.23.4, 24.22.1, and 26.12.1
([#3186](#3186)), by
@fengmk2.
- Reduce GitHub Actions cache storage and enable the e18e lint rules for
the repository
([#3149](#3149),
[#3088](#3088)), by
@fengmk2.
- Upgrade JavaScript dependencies and Rust crates, including
`@ast-grep/[email protected]` and `serial_test@4`
([#3108](#3108),
[#3109](#3109)), by
@renovate[bot].
- Refine the release-manager and vite-task bump guidance
([#3084](#3084),
[#3160](#3160)), by
@fengmk2 and @wan9chi.

### Bundled Versions

| Tool | Version | Source | Changelog |
| --------------- | ---------- |
---------------------------------------------------------------------------------------------------
| ----------------------------------------------------------------------
|
| vite | `8.3.5` |
[`981f07f`](vitejs/vite@981f07f)
| [8.3.5](https://github.com/vitejs/vite/releases/tag/v8.3.5) |
| rolldown | `1.2.15` |
[`89d821c`](rolldown/rolldown@89d821c)
| [1.2.15](https://github.com/rolldown/rolldown/releases/tag/v1.2.15) |
| oxc-node | `1.0.0` |
[`4759ced`](oxc-project/oxc-node@4759ced)
| [1.0.0](https://github.com/oxc-project/oxc-node/releases/tag/v1.0.0) |
| tsdown | `0.23.1` | [npm](https://npmx.dev/package/tsdown/v/0.23.1) |
unchanged |
| vitest | `5.0.5` | [npm](https://npmx.dev/package/vitest/v/5.0.5) |
unchanged |
| oxlint | `1.89.0` | [npm](https://npmx.dev/package/oxlint/v/1.89.0) |
[1.89.0](https://github.com/oxc-project/oxc/releases/tag/oxlint_v1.89.0)
|
| oxlint-tsgolint | `7.0.2004` |
[npm](https://npmx.dev/package/oxlint-tsgolint/v/7.0.2004) | unchanged |
| oxfmt | `0.74.0` | [npm](https://npmx.dev/package/oxfmt/v/0.74.0) |
[0.74.0](https://github.com/oxc-project/oxc/releases/tag/oxfmt_v0.74.0)
|

### Upgrade

```bash
vp upgrade
```

### New Contributors

@acalvino4, @Dev-next-gen, @0froq, @Crimson341, @Dunqing, @magurotuna,
@tlq5l

**Full Changelog**:
v1.3.0...v1.4.0

---

Merging this PR will trigger the release workflow.

---------

Co-authored-by: voidzero-guard[bot] <278573678+voidzero-guard[bot]@users.noreply.github.com>
Co-authored-by: MK (fengmk2) <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@BrewTestBot BrewTestBot mentioned this pull request Oct 23, 2026
vite-plus 1.4.0 Homebrew/homebrew-core#320609
Merged
@naokihaba naokihaba mentioned this pull request Nov 4, 2026
fix(env): call fish built-ins with builtin in env.fish #3353
Merged
fengmk2 pushed a commit that referenced this pull request Nov 5, 2026
@naokihaba
fix(env): call fish built-ins with builtin in env.fish (#3353)
fc9d5ba
## Context

* resolves #3128

When a user defines a fish function with the name of a built-in,
`env.fish` calls the user function instead of the built-in. With a user
`count` function, `vp env use` reports success, but the Node.js version
does not change.

The [fish documentation for
`function`](https://fishshell.com/docs/current/cmds/function.html) warns
about this case. It says that a function with the name of a built-in
often causes problems "in scripts written by others". `env.fish` is such
a script.

This PR adds
[`builtin`](https://fishshell.com/docs/current/cmds/builtin.html) to
each built-in that `env.fish` calls: `count`, `math`, `contains`,
`complete`, `commandline`, and `source`. `builtin` skips functions and
runs only the built-in. #3123 did the same for Nushell with the `%`
sigil.

This PR does not change the `vp` completion. clap_complete registers it
with bare `complete` and `commandline`, so `env.fish` cannot protect it.
fish's own completions also call bare `commandline`.


```text
# fish 4.9.3, vp built from 09961cf
# $R is a temporary VP_HOME. A line that starts with > is a command. [exit N] is the exit status of the command above it.

$ VP_HOME=$R VP_SELF_SETUP_NO_MODIFY_PATH=1 ./target/debug/vp env setup --refresh
[exit 0]
$ sed 's/builtin //g' $R/env.fish > $R/env-old.fish
$ diff $R/env-old.fish $R/env.fish | grep -c '^>'
14

## env-old.fish
> function count; echo 0; end
[exit 0]
> source env-old.fish
[exit 0]
> set -gx VP_NODE_VERSION 18.20.0
[exit 0]
> vp env use 20.20.2
Installing Node.js v20.20.2...
Using Node.js v20.20.2 (resolved from 20.20.2)
[exit 0]
> echo VP_NODE_VERSION=$VP_NODE_VERSION
VP_NODE_VERSION=18.20.0
[exit 0]
> node --version
v18.20.0
[exit 0]

## env.fish
> function count; echo 0; end
[exit 0]
> source env.fish
[exit 0]
> set -gx VP_NODE_VERSION 18.20.0
[exit 0]
> vp env use 20.20.2
Using Node.js v20.20.2 (resolved from 20.20.2)
[exit 0]
> echo VP_NODE_VERSION=$VP_NODE_VERSION
VP_NODE_VERSION=20.20.2
[exit 0]
> node --version
v20.20.2
[exit 0]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@fengmk2 fengmk2 fengmk2 approved these changes
+1 more reviewer
@nekomoyi nekomoyi nekomoyi approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@naokihaba naokihaba

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Nushell env bug: Positional completer input deprecated

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@naokihaba @fengmk2 @nekomoyi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.