Repository navigation
Set __VFOX_SHELL in all shell hooks to prevent spawning subprocess on global use - #584
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #583 by ensuring the __VFOX_SHELL environment variable is set in all shell hook scripts. This prevents vfox from spawning unnecessary subprocesses when using global scope commands, as the IsHookEnv() function relies on this variable to detect if the shell has hook support configured.
Key Changes:
- Added
__VFOX_SHELLenvironment variable initialization in all shell activation hooks (bash, zsh, fish, powershell, clink) - Each shell sets the variable using its appropriate syntax with the correct shell identifier
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/shell/bash.go | Added export __VFOX_SHELL='bash' to bash hook script |
| internal/shell/zsh.go | Added export __VFOX_SHELL='zsh' to zsh hook script |
| internal/shell/fish.go | Added set -x -g __VFOX_SHELL 'fish' to fish hook script |
| internal/shell/powershell.go | Added $env:__VFOX_SHELL = 'pwsh' to PowerShell hook script |
| internal/shell/clink.go | Added set "__VFOX_SHELL=clink" to clink hook script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bytemain
approved these changes
Dec 25, 2025
6 of 7 tasks
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.
0.9.1and0.9.2,vfox use --globaldoes not work on Windows #583 .__VFOX_SHELLin all shell hooks to prevent spawning subprocess on global use.