Repository navigation
feat(shell): add nushell shell hook integration - #720
AdamMagued wants to merge 3 commits into
Conversation
Support direct Nushell activation script generation, recognize nu and powershell shell aliases in NewShell, and avoid invoking hide-env with empty variable lists.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main version-fox/vfox#720 +/- ##
==========================================
+ Coverage 51.39% 51.67% +0.28%
==========================================
Files 111 111
Lines 8240 8245 +5
==========================================
+ Hits 4235 4261 +26
+ Misses 3583 3565 -18
+ Partials 422 419 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
linghengqian
left a comment
There was a problem hiding this comment.
Supports direct Nushell activation script generation (vfox activate nu / vfox activate nushell) without requiring explicit config path arguments.
- I didn't quite understand what this sentence means. Does this really not require updating the Chinese and English documentation at https://vfox.dev/guides/quick-start.html#_2-hook-vfox-to-your-shell?
linghengqian
left a comment
There was a problem hiding this comment.
If you do not provide an explanation regarding https://github.com/version-fox/vfox/issues/719#issuecomment-6104802936 , I will close this PR in a month.
|
Thank you for the review. To clarify the relationship with issue version-fox/vfox-plugins#44:
Regarding the documentation and tests:
|
|
w.r.t. this - #720 (review) Thanks for the review it seems the PR description now more lucid and covers your concern, if this gets included into a pre-release ping me I wanna test it out. Thanks for the hard work. |
linghengqian
left a comment
There was a problem hiding this comment.
@sweetrollsuranusbear Who are you?
|
wrt #720 (review) I dunno. if you wanna know wouldn't it make more sense to have a GitHub Discussions enabled? I am also more interested in collaboration or contribution on vfox whichever you personally prefer. Don't wanna pollute the PR with that discussion, it would get long. |
linghengqian
left a comment
There was a problem hiding this comment.
@sweetrollsuranusbear If you continue to use an ai agent to generate these kinds of rambling, off-topic responses, I will block you from the vfox organization. We do not use the discussion forum.
aooohan
left a comment
There was a problem hiding this comment.
The implementation looks good to me. I checked 58f1a63 and ran all three documented setup methods in native Nushell 0.116.1: the config-directory form, appending the hook directly, and vendor autoload. With an isolated home/config and a fixture SDK, startup loaded the SDK environment and the prompt hook worked in each case.
The build, go vet ./..., and CI=true go test ./... all passed with Go 1.24.0 on macOS arm64.
There's still a merge conflict in internal/shell/nushell_test.go. Please keep both the baseline regression test from main and the new activation tests when resolving it. I tested a temporary merge with main at feb6092 that retained both sets of tests: the full suite, vet, and build passed. I also reran all three setup methods in native Nushell and checked that inherited PATH entries moved behind the SDK while entries added after activation stayed in front.
No blocking code findings from me. The conflict still needs to be resolved on the PR before merging.
|
@aooohan Merged upstream main and resolved the conflict in internal/shell/nushell_test.go. Both the baseline PATH recording regression test (TestNushellActivateRecordsTheBaseline) and the activation test suite (TestNushellActivateWithPidCheck, TestNushellActivateDirect, TestNushellActivateErrors, TestNushellActivateCreatesConfigDir) have been retained. Verified locally and in a clean container environment:
The branch is clean and ready for merge. |
linghengqian
left a comment
There was a problem hiding this comment.
I honestly don’t see how this PR relates to https://github.com/version-fox/vfox/issues/719 at all. If you encountered a bug while using vfox in Nushell, which issue contains the original bug report?
|
To eliminate any confusion, I have removed the reference to version-fox/vfox-plugins#44 from the PR description. This PR was not opened to address a bug report issue, but as a standalone feature contribution providing native shell hook integration for Nushell ( As @aooohan confirmed and approved after testing in native Nushell 0.116.1, the integration is verified and the merge conflict in |
linghengqian
left a comment
There was a problem hiding this comment.
I think you might have misunderstood what I meant. Documentation on how to configure Nushell has always been included in previous versions. What would happen if your PR weren't there?

Summary
This change enhances Nushell shell integration across vfox:
nualongsidenushell(as well aspowershellalongsidepwsh) inshell.NewShell.vfox activate nu/vfox activate nushell) without requiring explicit config path arguments. When called without arguments, the rendered activation script is emitted directly to standard output.vfox activate nu $nu.default-config-dir), continuing to writevfox.nuto the target directory and returning the source command.hide-envandload-envexecution in Nushell so variables are only processed when non-empty, avoiding errors when attempting to hide empty variable lists.