Skip to content

Set __VFOX_SHELL in all shell hooks to prevent spawning subprocess on global use - #584

Merged
bytemain merged 1 commit into
version-fox:mainfrom
linghengqian:fix-powershell
Dec 26, 2025
Merged

bytemain merged 1 commit into
version-fox:mainfrom
linghengqian:fix-powershell

Conversation

@linghengqian

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings December 25, 2025 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SHELL environment 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: For versions 0.9.1 and 0.9.2, vfox use --global does not work on Windows

3 participants