diff --git a/scripts/code.sh b/scripts/code.sh index 0afe96bfcb6a575a1122bb2a4abe95307181767d..efa6daa93719eca40e7201426c1307492d1139a0 100755 --- a/scripts/code.sh +++ b/scripts/code.sh @@ -55,6 +55,9 @@ function code() { function code-wsl() { + HOST_IP=$(powershell.exe -Command "& {(Get-NetIPAddress | Where-Object {\$_.InterfaceAlias -like '*WSL*' -and \$_.AddressFamily -eq 'IPv4'}).IPAddress}") + export DISPLAY="$HOST_IP:0" + # in a wsl shell ELECTRON="$ROOT/.build/electron/Code - OSS.exe" if [ -f "$ELECTRON" ]; then