Windows Terminal Support using WSL
Historically NetBeans relied on cygwin or MSYS to provide a shell on windows.
With WSL (the windows subsystem for linux) an alternative was established, that runs a full linux kernel inside a windows session, providing a full linux userland, including a shell.
The benefit of WSL is, that it is built-in technology and thus has a lower threshold for installation than cygwin. The drawback is, that initial startup of wsl is slower than opening a cygwin/MSYS bash.
The change here tries to check that
- WSL2 is available and
- that a distribution is installed in WSL2
If this is the case NetBeans defaults to WSL.
Users can override the automatic detection by setting the org.netbeans.modules.nativeexecution.api.util.WindowsSupport.shellProvider system property to CYGWIN, MSYS or WSL.
Here is a screenshot with a testsystem with WSL and Cygwin both present, but WSL has no distribution installed:
The same system after installing Ubuntu and restarting NetBeans:
Closes: #3959
work nice !! Thanks for this feature.
Testing today showed that the WSL emulation is incomplete. Searching showed that the problem is known: https://github.com/microsoft/WSL/issues/10311 (WSL doesn't automatically mount drive letters added by subst command)). You can't execute wsl commands on drives bound using subst and for me it also failed for network drives.
Testing today showed that the WSL emulation is incomplete. Searching showed that the problem is known: microsoft/WSL#10311 (WSL doesn't automatically mount drive letters added by subst command)). You can't execute wsl commands on drives bound using
substand for me it also failed for network drives.
The fail comes from the netbeans pty tool. The pty tool is invoked with the target directory, but "special" drives are not mapped. My tests indicate, that wsl:
- supports regular drives
- supports drives mapped using virtiofs
- does not support mapped network drives
- does not support drives mapped by
subst