-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
testdir/test_exists.vim: add test for empty environment variable #4750
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
Conversation
Setting an empty string to an environment variable deletes the variable on Windows. |
Is that a Windows issue, or due to how Vim does it? For setting: https://github.com/neovim/libuv/blob/c41b31ed3b88aacae1d8498d0f3f6bbc20d56f9a/src/win/util.c#L1456-L1484 But likely more related to how it gets it: https://github.com/neovim/libuv/blob/c41b31ed3b88aacae1d8498d0f3f6bbc20d56f9a/src/win/util.c#L1456-L1484 |
It's the behavior of |
I see. Should we adjust this test and the one in #4751 for win32 behavior then? |
I think so. |
btw: I've also noted that unlet! $VIMRUNTIME
" Fails
echo environ()['VIMRUNTIME']
" Works
echo getenv('VIMRUNTIME')
echo environ()['VIMRUNTIME'] This is due to the side-effect of |
This is not portable, different systems have different ideas about whether an environment variable with an empty value exists or not. |
I think Vim is defining it in this case (since Neovim handles it differently on the same system (Windows)), and if the special behavior with win32 is kept, then it would be good to have this tested / documented. |
This adds coverage for this in general, and tests the specific/current behavior on Windows. Ref: vim#4750 (comment)
Ref: neovim/neovim#10657