You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The command vfox cd does not work on Windows. Instead of switching the shell directory as expected, it prints the usage instructions.
Screenshots[optional]
~/Documents/CodeRepo/Project/vfox> vfox cd 04/24/2024 03:15:38 PM
NAME:
vfox - vfox is a tool for runtime version management.
USAGE:
vfox [command] [command options]
VERSION:
0.4.1
DESCRIPTION:
vfox is a cross-platform version manager, extendable via plugins. It allows you to quickly install and switch between different environment you need via the command line.
COMMANDS:
config Setup, view config
cd Launch a shell in the VFOX_HOME or SDK directory
help, h Shows a list of commands or help for one command
Plugin:
info Show plugin info
available Show all available plugins
update Update specified plugin, use --all/-a to update all installed plugins
remove Remove a plugin
add Add a plugin or plugins
SDK:
install, i Install a version of the target SDK
current, c Show current version of the target SDK
use, u Use a version of the target SDK
list, ls List all versions of the target SDK
uninstall, un Uninstall a version of the target SDK
search Search a version of the target SDK
env
GLOBAL OPTIONS:
--debug show debug information (default: false)
--help, -h show help
--version, -v, -V print version (default: false)
COPYRIGHT:
Copyright 2024 Han Li. All rights reserved.
~/Documents/CodeRepo/Project/vfox>
Sunrise@Yane MINGW64 ~
$ echo $VFOX_HOME
C:\Users\Sunrise\.version-fox
Sunrise@Yane MINGW64 ~
$ vfox cd
open a new shell failed, err:exec: no command
Sunrise@Yane MINGW64 ~
$ vfox use [email protected]
Now using [email protected].
Sunrise@Yane MINGW64 ~
$ vfox cd ruby
open a new shell failed, err:exec: no command
After further exploration, I found that the vfox I compiled myself works in both powershell and nushell, with the path variable correctly assigned to the shell's executable. However, the behavior of vfox installed via Scoop is the same as in Git Bash, where the path variable is empty.
Activity
aooohan commentedon Apr 25, 2024
PowershellandClinkare not reproduced, what shell are you using,gitbash?yanecc commentedon Apr 25, 2024
I'm using Powershell, and it can reproduce stably.
alenros commentedon Apr 29, 2024
vfox cdworks for me both with PS and PS Core:Name Value
PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2506
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Name Value
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
yanecc commentedon May 26, 2024
It doesn't work in git bash either.
yanecc commentedon May 27, 2024
After further exploration, I found that the vfox I compiled myself works in both powershell and nushell, with the
pathvariable correctly assigned to the shell's executable. However, the behavior of vfox installed via Scoop is the same as in Git Bash, where thepathvariable is empty.vfox/internal/shell/windows_process.go
Line 49 in 52ff51c
aooohan commentedon May 28, 2024
Good catch!
scoopexposesvfoxto PATH using a shim, which results inpidput in this function that is not the shell's but the scoop shim.We may need to modify
manifestprovided toscoopto exposevfoxdirectly toPATHwithout using a shim.https://github.com/ScoopInstaller/Main/blob/2a4ee74939962bdc224e1a1554078e76ca089ca4/bucket/vfox.json#L27
fix(cd): skip same-named executable shims when finding the shell
fix: recover interrupted installs and correct shell integration (vers…