xilun / cbwin

Launch Windows programs from "Bash on Ubuntu on Windows" (WSL)
Other
327 stars 25 forks source link

can't set win32 working directory #1

Closed xilun closed 8 years ago

xilun commented 8 years ago

this is implemented on the win32 launcher side, but something is needed on the WSL side

behavior: the case when we are under /mnt// is easy: just translate to win32 path.

otherwise: By default, wcmd should refuse to launch when invoked from the pure WSL VFS, because it is quite likely to invoke a command that would want to touch files and there is no way to do that from win32 (there are files that can be viewed under appdata but nothing there should be touched from win32). It could be useful to allow wstart from a fallback win32 directory. Either the one from where outbash was launched, or maybe %HOMEDRIVE%%HOMEPATH%. (but outbash shall not do SetCurrentDirectory anyway because the most useful behavior is to stay in the one it was launched from, given Win32 kind of "locks" the current directory of a running process, and bash.exe already probably just stays there already). wrun could be somewhere between wstart and wcmd. I guess the simplest for wrun, at least in a first time, is to do like wcmd. (wrun should probably not be used very often in the first place anyway -- maybe I should rename it.)

xilun commented 8 years ago

Implemented on the WSL side with the new .c caller. In a first time everybody has the same behavior: calls are only allowed from under /mnt/[/...]