vfox
vfox copied to clipboard
tmux inherits environment variables causing __VFOX_CURTMPPATH to be reused
a bit better screen that may give you some additional hints
Originally posted by @ZuBB in https://github.com/version-fox/vfox/issues/364#issuecomment-2443873158
@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"
this config/option did the trick @jan-bar
@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.
So is there a fix for this issue on your side, or I have to tweak config of tmux?
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.
Then maybe adding a note to the docs would be nice?
Yes, you can submit a PR. I haven't submitted a PR related to documentation yet. :smile:
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.
I encountered a similar problem when using fish + tmux + vfox: when I reconnect to an existing tmux, my vfox environment is often lost(dotnet, node). And I find this issue. Could you give me a sample tmux configuration to avoid this problem? Thanks a lot~
@AliveNeko You can use this solution https://github.com/version-fox/vfox/issues/375#issuecomment-2445725062 ,The principle is to remove those environment variables through the subprocess started by tmux.
@AliveNeko You can use this solution #375 (comment) ,The principle is to remove those environment variables through the subprocess started by tmux.
My bad, I didn't see the above configuration. Thank you very much!❤️
I would like to add that this also happens if you launch the system from the tty in linux. I solved it by adding an script to my .zshrc to only activate vfox when the terminal is not the tty. I think that this also should be added to the docs.