MSYS2 and cygwin adopt Windows environmental variables selectively. For example, PATH, CygwinMsysPATH
Setting envars in Windows is also an art or science: https://learn.microsoft.com/en/answers/questions/2278439/environment-variable-not-being-changed-as-expected
Following the https://learn.microsoft.com links there, you will learn that:
SET /? and SETX /? in a cmd
shell are your friend.
An ‘unknown known’ surely. See UnknownKnowns.
To delete user envars:
reg delete “HKCU\Environment” /v VAR_NAME /f
Not effected until re-login?
And the use by MSYS2 of Windows %HOME% usefully set or not set to C:/Users/%USERNAME% is discussed on StackOverflow
Or set to HOMEDRIVEHOMEPATH
Me atBack to HomePage