Skip to content

Add --full-reparse/-f to run command#18339

Merged
fdncred merged 3 commits into
nushell:mainfrom
fdncred:fdncred/run-full-reparse
Jun 4, 2026
Merged

Add --full-reparse/-f to run command#18339
fdncred merged 3 commits into
nushell:mainfrom
fdncred:fdncred/run-full-reparse

Conversation

@fdncred
Copy link
Copy Markdown
Contributor

@fdncred fdncred commented Jun 4, 2026

Description

This PR fixes 2 bugs in the run command.

  1. It allows for a user to use run in non-caching mode by specifying run --full-reparse/-f. This is good for situations like this watch . -g *.nu | where path ends-with test.nu | each -f { run -f test.nu } when a user is editing test.nu over and over again. However, one should be careful because test.nu could be looked up from other viable locations. It's better to use something like ./test.nu. I actually ran into this while testing.
  2. It fixes a bug where the decl lookup wasn't correct so nu -n and then run toolkit.nu would only work once when you should be able to run toolkit.nu many times in the repl.

User-facing changes (Release notes)

Bug fixes

  • watch . -g *.nu | where path ends-with test.nu | each -f { run -f ./test.nu } now works.
  • nu -n then run toolkit.nu then run toolkit.nu now works, previously it didn't allow running it more than once due to a bug in caching.

Additional notes

@github-actions github-actions Bot added the A:parser Issues related to parsing label Jun 4, 2026
@fdncred fdncred added the notes:hide Noted only in "Full Changelog" section label Jun 4, 2026
Comment thread crates/nu-command/src/misc/run.rs Outdated
@fdncred fdncred merged commit ec8a3b2 into nushell:main Jun 4, 2026
17 checks passed
@fdncred fdncred deleted the fdncred/run-full-reparse branch June 4, 2026 20:17
@github-actions github-actions Bot added this to the v0.114.0 milestone Jun 4, 2026
nidara-duo pushed a commit to nidara-duo/nushell that referenced this pull request Jun 5, 2026
## Description

This PR fixes 2 bugs in the `run` command.
1. It allows for a user to use `run` in non-caching mode by specifying
`run --full-reparse/-f`. This is good for situations like this `watch .
-g *.nu | where path ends-with test.nu | each -f { run -f test.nu }`
when a user is editing `test.nu` over and over again. However, one
should be careful because `test.nu` could be looked up from other viable
locations. It's better to use something like `./test.nu`. I actually ran
into this while testing.
2. It fixes a bug where the decl lookup wasn't correct so `nu -n` and
then `run toolkit.nu` would only work once when you should be able to
`run toolkit.nu` many times in the repl.

## User-facing changes (Release notes)
Bug fixes
- `watch . -g *.nu | where path ends-with test.nu | each -f { run -f
./test.nu }` now works.
- `nu -n` then `run toolkit.nu` then `run toolkit.nu` now works,
previously it didn't allow running it more than once due to a bug in
caching.

## Additional notes
<!--
Optional.

Examples:
- fixes nushell#123
- closes nushell#456
- related nushell#789

Anything else reviewers should know.
Remove this section if not needed.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:parser Issues related to parsing notes:hide Noted only in "Full Changelog" section

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant