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

HOME folder setting #40

Closed
j-c-m opened this issue Apr 17, 2017 · 6 comments
Closed

HOME folder setting #40

j-c-m opened this issue Apr 17, 2017 · 6 comments

Comments

@j-c-m
Copy link

j-c-m commented Apr 17, 2017

Where does the HOME environment get set to %LOCALAPPDATA%\wsltty\home\%USERNAME% ?

I am running into minor issues now that it is possible to execute windows binaries from WSL. Example: If I start visual studio code from WSL, it inherits the HOME environment, but the windows git it executes expects the HOME to be set to %USERPROFILE% or empty (and then it defaults it to %USERPROFILE), so now this process can't find ssh keys while running git.

Is it possible to unset the wsltty specific HOME environment variable before executing into WSL?

@mintty
Copy link
Owner

mintty commented Apr 18, 2017

Actually wsltty does not set HOME specifically. If you set HOME before starting it, the "home" directory would be different from %LOCALAPPDATA%\wsltty\home\%USERNAME%, anyway.
About handling HOME when starting something from WSL, this is really not of wsltty concern.

@j-c-m
Copy link
Author

j-c-m commented Apr 18, 2017

Thanks, I had later figured out setting HOME before starting resolved the issue as you described

My understanding now is that cygwin is responsible for setting the HOME (when unset) and wsltty just uses what it determines?

@mintty
Copy link
Owner

mintty commented Apr 18, 2017

There seems to be a misunderstanding, or I don't see what your actual issue is.
The HOME we are talking about is not the HOME later set and used by WSL.

@j-c-m
Copy link
Author

j-c-m commented Apr 18, 2017

If the windows environment variable HOME is unset. When wsltty is executed, mintty (I believe specifically the underlying cygwin library) sets the windows HOME environment variable to %LOCALAPPDATA%\wsltty\home\%USERNAME% for its sub-processes. You are correct that this does not have an effect on the Linux portion of WSL. However if you run a windows command from WSL, it inherits what I would consider an app specific HOME environment variable.

@mintty
Copy link
Owner

mintty commented Apr 19, 2017

So if you start a Windows program from WSL, the WSL HOME is bypassed and the previous HOME passed to the program?
If that's the case, and your Windows program depends on a certain HOME setting, you should configure that setting at Windows level. This might actually affect the wsltty config reference, so if that's the issue, we may talk about it...

mintty added a commit that referenced this issue May 19, 2017
@mintty
Copy link
Owner

mintty commented May 19, 2017

Released 0.7.7.

@mintty mintty closed this as completed May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants