Skip to content

[BUG]: vfox cd doesn‘t work on Windows #238

Closed

Description

@yanecc

Version
0.5.3

OS
Windows

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>

Activity

  1. added
    bug
    on Apr 24, 2024
  2. aooohan commented on Apr 25, 2024

    @aooohan
    Member

    Powershell and Clink are not reproduced, what shell are you using, gitbash?

  3. yanecc commented on Apr 25, 2024

    @yanecc
    ContributorAuthor

    Powershell and Clink are not reproduced, what shell are you using, gitbash?

    I'm using Powershell, and it can reproduce stably.

    PS C:\Users\Sunrise> $psversiontable
    
    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
    
  4. alenros commented on Apr 29, 2024

    @alenros

    vfox cd works 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

  5. yanecc commented on May 26, 2024

    @yanecc
    ContributorAuthor

    It doesn't work in git bash either.

    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
    
  6. yanecc commented on May 27, 2024

    @yanecc
    ContributorAuthor

    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.

    path := strings.TrimPrefix(strings.TrimSpace(string(output)), "ExecutablePath=")

  7. aooohan commented on May 28, 2024

    @aooohan
    Member

    However, the behavior of vfox installed via Scoop is the same as in Git Bash, where the path variable is empty.

    Good catch!

    scoop exposes vfox to PATH using a shim, which results in pid put in this function that is not the shell's but the scoop shim.

    We may need to modify manifest provided to scoop to expose vfox directly to PATH without using a shim.

    https://github.com/ScoopInstaller/Main/blob/2a4ee74939962bdc224e1a1554078e76ca089ca4/bucket/vfox.json#L27

  8. added a commit that references this issue on Sep 12, 2026
    7bc4b2f
  9. added a commit that references this issue on Sep 12, 2026
    70d41d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions