Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

convert absolute executable path to Win32 in wrun & better handling of Ctrl-C

Pre-release
Pre-release
Compare
Choose a tag to compare
@xilun xilun released this 28 Oct 20:48
· 54 commits to master since this release

wrun now converts absolute executable path in DriveFs to Win32 path, and also pass it to outbash.exe in a separated field. This lets use it instead of /init as a .exe interpreter on Windows Insider builds >= 14951. However, note that wrun still won't let spawned Win32 processes survive to its own death by default, so unless you have a special reason to want to do that I do not particularly recommend it. Also, the behavior has not changed for relative paths, and will not be very good in case of spaces in the executable path in this case...

Example (only for Windows Insider builds >= 14951):

$ sudo -s
# cd /proc/sys/fs/binfmt_misc
# echo -1 > WSLInterop
# echo ":WSLInterop:M::MZ::/usr/local/bin/wrun:" > register
# exit
$ export PATH="$PATH:/mnt/c/Windows/System32"
$ notepad.exe & ps x | grep notepad.exe | grep -v grep
2475 tty1     S      0:00 /usr/local/bin/wrun /mnt/c/Windows/System32/notepad.exe

Note that in Win 10 1607, you don't have the binfmt_misc feature in WSL. However, cbwin still runs perfectly well there if you invoke it explicitly (and future versions of cbwin will continue to target Win 10 1607).

EDIT: this release should also prevent Ctrl-C from closing the whole session when some Win32 console programs are running.

To install from the binary archive, copy outbash.exe where you want.

Launch a "Bash on Ubuntu on Windows" session with outbash.exe, and from your unpacked archive directory launch sudo ./install.sh (this will put the WSL wcmd/wstart/wrun commands in /usr/local/bin)

Enjoy!