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

Start in user home #2

Closed
fpqc opened this issue Sep 16, 2016 · 9 comments
Closed

Start in user home #2

fpqc opened this issue Sep 16, 2016 · 9 comments

Comments

@fpqc
Copy link

fpqc commented Sep 16, 2016

Hi, wondering if you can tell the wslbridge to start in the user's home.

The built-in bash.exe in system32 allows you to start it with
bash.exe ~ -c "linux program to start"

Is there a way to start the wslbridge in a specific lxss directory?

@mintty
Copy link

mintty commented Sep 18, 2016

I was about to ask the same, caused by the discussion in mintty/wsltty#3

@fpqc
Copy link
Author

fpqc commented Sep 18, 2016

@mintty I know. I realized that the correct place to ask was upstream here.

@rprichard
Copy link
Owner

I think I agree that there should be some option for controlling the start dir.

@fpqc
Copy link
Author

fpqc commented Sep 18, 2016

@rprichard By the way, this project is amazing.Was wondering if there is a way to make it work using ttys rather than ptys in WSL.

@rprichard
Copy link
Owner

@fpqc What do you mean by tty support?

Regarding the feature request, there are three kinds of paths wslbridge could accept for the startdir: a Windows path, a Cygwin path, or a WSL path.

My first instinct is that only WSL paths are worth handling -- the others can be accommodated by setting the starting directory before invoking wslbridge. Maybe wslbridge could have a -C<WSLPATH> option. If the first path component of WSLPATH is ~ or ~user, wslbridge could replace it with the appropriate directory. (Someone invoking wslbridge from Cygwin bash would have to be a bit careful. Running wslbridge -C ~ from bash would do the wrong thing, because Cygwin would interpret ~ before wslbridge.)

@rprichard
Copy link
Owner

wslbridge could also do things like substitute environment variables in WSLPATH, but that strikes me as unnecessary.

@fpqc
Copy link
Author

fpqc commented Sep 19, 2016

@rprichard Only one worth doing is a WSL path. The other two can be legitimately achieved with the "start in" function of Windows.

rprichard added a commit that referenced this issue Sep 28, 2016
If the argument is '~' or starts with '~/', then the '~' is replaced with
the content of the HOME environment variable.

Implements #2
@rprichard
Copy link
Owner

I added a -C option that changes the working directory before exec'ing the child process. It has special code to interpret a ~ at the start, so passing -C~ to wslbridge will start the child in the WSL home directory.

@fpqc
Copy link
Author

fpqc commented Sep 28, 2016

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants