Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Session-scoped vfox u -s fails on Windows because __VFOX_CURTMPPATH isn't exported, causing each invocation to potentially use different temp directories.

Root Cause

The shell hook sets __VFOX_PID and __VFOX_SHELL, then each prompt calls vfox env -s pwsh. The env command creates a temp directory path using these variables, stores session versions in {temp}/.tool-versions, but never exports the temp path back to the shell. Subsequent vfox commands then create new temp paths, losing session state.

Changes

  • Export __VFOX_CURTMPPATH in envFlag() to persist temp directory path across invocations
  • Use internal.HookCurTmpPath constant for consistency with existing code (matches activate.go)
exportEnvs := sdkEnvs.ToExportEnvs()

// Always export __VFOX_CURTMPPATH so that all vfox commands in the session use the same temp directory
curTmpPath := manager.PathMeta.CurTmpPath
exportEnvs[internal.HookCurTmpPath] = &curTmpPath

exportStr := s.Export(exportEnvs)

This ensures all commands in a shell session share the same temp directory for session-level version management.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • version-fox.github.io
    • Triggering command: /tmp/go-build3603188520/b363/http.test /tmp/go-build3603188520/b363/http.test -test.testlogfile=/tmp/go-build3603188520/b363/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.short=true x64/src/runtime/-D uavocPfSd ache/go/1.24.11/-o yAccounting=yes ota=5% yHigh=170M 01.o ortc�� x64/src/runtime/cgo x64/src/path/match.go ache/go/1.24.11/x64/pkg/tool/lin-lang=go1.18 user.name (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG]: 0.6.5之后vfox u -s命令失效,未修改Path变量</issue_title>
<issue_description>Version
0.6.5之后

OS
Windows

Describe the bug
0.6.5之后vfox u -s命令失效,未修改Path变量

亲测0.6.5版本是可行的,不知是否与0.6.6版本开始新增的VFOX_*相关环境变量有关

Screenshots[optional]

Image

Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@jan-bar https://github.com//issues/342#issuecomment-3531176781

执行env | grep __VFOX看看,我上面那个issues也备注了,看下是不是我遇到的问题。问题表现是 __VFOX_PID__VFOX_CURTMPPATH最后的数字不一致。</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix vfox u -s command failure after version 0.6.5 Fix session-scoped use command by exporting __VFOX_CURTMPPATH Dec 26, 2025
Copilot AI requested a review from bytemain December 26, 2025 08:54
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]: 0.6.5之后vfox u -s命令失效,未修改Path变量

2 participants