version-fox / vfox

A cross-platform and extendable version manager with support for Java, Node.js, Flutter, .Net & more
https://vfox.lhan.me
Apache License 2.0
2.84k stars 102 forks source link

tmux inherits environment variables causing __VFOX_CURTMPPATH to be reused #375

Open jan-bar opened 1 week ago

jan-bar commented 1 week ago
          a bit better screen that may give you some additional hints
image

Originally posted by @ZuBB in https://github.com/version-fox/vfox/issues/364#issuecomment-2443873158

jan-bar commented 1 week ago

@ZuBB

Use the following tmux configuration to see if there is any problem with my verification.

cat ~/.tmux.conf 

set-option -g default-command "env -u __VFOX_CURTMPPATH -u __VFOX_PID -u __VFOX_SHELL fish"
ZuBB commented 18 hours ago

this config/option did the trick @jan-bar

image
jan-bar commented 12 hours ago

@ZuBB I'm glad to solve this problem. The reason for the problem is that tmux will inherit environment variables when creating a new terminal, and the __VFOX_XXX environment variables have special uses.

ZuBB commented 8 hours ago

So is there a fix for this issue on your side, or I have to tweak config of tmux?

jan-bar commented 7 hours ago

I don’t have a good solution, and many people are troubled by this feature of tmux, which can be avoided by modifying the tmux configuration, so I don’t think it’s necessary to fix it.

ZuBB commented 7 hours ago

Then maybe adding a note to the docs would be nice?

jan-bar commented 6 hours ago

Yes, you can submit a PR. I haven't submitted a PR related to documentation yet. :smile: