Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: vfox 在iterm2中出现无法在会话中切换环境版本 #294

Closed
fangzhengjin opened this issue May 28, 2024 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@fangzhengjin
Copy link
Contributor

Version
0.5.3
OS
macOS

Describe the bug
使用vfox u -g java设置全局版本后,在会话中使用vfox u java临时切换版本无效
并且观察到在控制台只要有命令执行,并没有使用vofx命令vfox也会一直在temp下创建临时目录

Screenshots[optional]
If applicable, add screenshots to help explain your problem.

@fangzhengjin fangzhengjin added the bug Something isn't working label May 28, 2024
@aooohan
Copy link
Member

aooohan commented May 28, 2024

贴一下debug日志.

vfox --debug use java

你用的zulu吗

@fangzhengjin
Copy link
Contributor Author

vfox --debug use java
Please select a version of java:
  -> 11.0.22+7-tem
Use SDK version: 11.0.22+7-tem, scope:session
plugin does not have PreUse function
Removing old package path: /Users/xxxxxx/.version-fox/temp/1716825600-17832/java
Create symlink /Users/xxxxxx/.version-fox/cache/java/v-11.0.22+7-tem/java-11.0.22+7-tem -> /Users/xxxxxx/.version-fox/temp/1716825600-17832/java
Now using java@11.0.22+7-tem.
image

@fangzhengjin
Copy link
Contributor Author

下面是频繁创建目录的录屏

Screen-2024-05-28-150009.mp4

@aooohan
Copy link
Member

aooohan commented May 28, 2024

你用的这是什么shell, 正常来说这个临时目录只会在第一次打开shell的时候创建.

@fangzhengjin
Copy link
Contributor Author

fangzhengjin commented May 28, 2024

你用的这是什么shell, 正常来说这个临时目录只会在第一次打开shell的时候创建.

zsh + iterm2 + omzsh + starship

@fangzhengjin
Copy link
Contributor Author

我试了下排除法,只要不用iterm2就可以。。。很奇怪

@fangzhengjin
Copy link
Contributor Author

看起来是iterm2出了什么问题,退出重启iterm2恢复正常了

@fangzhengjin
Copy link
Contributor Author

试了很多次,包括重装iterm2,还是会出现这种情况,不知道还有没有其他使用iterm2的朋友遇到这种

@fangzhengjin fangzhengjin changed the title [BUG]: vofx 无法在会话中切换环境版本 [BUG]: vofx 在iterm2中出现无法在会话中切换环境版本 Jun 3, 2024
@bytemain bytemain changed the title [BUG]: vofx 在iterm2中出现无法在会话中切换环境版本 [BUG]: vfox 在iterm2中出现无法在会话中切换环境版本 Jun 10, 2024
@fangzhengjin
Copy link
Contributor Author

此问题出现的原因是有一些命令行智能补全工具,例如FigAmazon Q会在用户输入时启动子进程展示补全信息,子进程会重复初始化vfox环境,导致主进程的vfox异常

@fangzhengjin
Copy link
Contributor Author

新版本发布前的临时解决方式是使用下方的初始化脚本控制vfox的初始化时机

if [[ -z "$__VFOX_PID" ]]; then
    eval "$(vfox activate zsh)"
fi

@fangzhengjin
Copy link
Contributor Author

closed by #311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants