Repository navigation
fix(shell): read nushell wrapper temp files past a user open alias - #4865
Merged
Merged
Conversation
An alias or custom command named open in config.nu is in scope when the vendor-autoload wrapper is parsed, so the wrapper's reads of its cd and stdout files ran the user's command instead. On macOS, where alias open = ^open is common, wt switch printed Switched and left the shell where it was. The wrapper now hides open in its own body, which restores the builtin there without touching the user's scope. Closes #4862
This was referenced Nov 20, 2026
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A
config.nualias or custom command namedopenis in scope when Nushell parses the wrapper from vendor autoload, so the wrapper'sopen $cd_file --rawandopen $stdout_file --rawran the user's command instead of reading the files. Withalias open = ^open(common on macOS),wt switchprinted "Switched" and the shell stayed put. The wrapper now runshide openat the top of its body. That restores the builtin for the wrapper only: the user's alias still applies outside it, and with no alias definedhide openis a no-op (checked on nu 0.117).test_nu_wrapper_reads_survive_open_aliasdefinesalias open = ^echo ALIASEDbefore the wrapper, then runswt switch --createandwt config show. Before the change it failed withDirectory not found … 'ALIASED /tmp/tmp.… --raw' does not exist. It now passes, along with the othernu_wrappertests and theinit_nusnapshot, which picks up the new lines.The
rmcleanup got the same protection in #3730. The wrapper's other bare builtins (cd,mktemp,print) are unchanged.Closes #4862 — automated triage