Handle WSL2 networking changes for Xserve

This commit is contained in:
Jeremy Wall 2020-02-13 18:24:09 -06:00
parent 760c09841e
commit 6943e02ec2

View File

@ -3,8 +3,9 @@ param (
$CommandPath = "konsole"
)
$server = (wsl.exe cat /etc/resolv.conf | Select-String nameserver | Out-String | ForEach-Object { $_.Split(" ")[1]}).Trim()
# Set the display variable for this process
Set-Item -Path Env:DISPLAY "127.0.0.1:0.0"
Set-Item -Path Env:DISPLAY "$server`:0.0"
Set-Item -Path Env:WSLENV "DISPLAY/u"
Start-Process -FilePath "wsl.exe" -ArgumentList $CommandPath -WindowStyle Hidden