Files
oak-gpui/crates/zed/resources/windows/zed-wsl
T
Max BrunsfeldandJunkui Zhang f78f3e7729 Add initial support for WSL (#37035)
Closes #36188

## Todo

* [x] CLI
* [x] terminals
* [x] tasks

## For future PRs
* debugging
* UI for opening WSL projects
* fixing workspace state restoration

Release Notes:

- Windows alpha: Zed now supports editing folders in WSL.

---------

Co-authored-by: Junkui Zhang <364772080@qq.com>
2025-08-29 17:18:52 -07:00

26 lines
508 B
Bash

#!/usr/bin/env sh
if [ "$ZED_WSL_DEBUG_INFO" = true ]; then
set -x
fi
ZED_PATH="$(dirname "$(realpath "$0")")"
IN_WSL=false
if [ -n "$WSL_DISTRO_NAME" ]; then
# $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2
IN_WSL=true
fi
if [ $IN_WSL = true ]; then
WSL_USER="$USER"
if [ -z "$WSL_USER" ]; then
WSL_USER="$USERNAME"
fi
"$ZED_PATH/zed.exe" --wsl "$WSL_USER@$WSL_DISTRO_NAME" "$@"
exit $?
else
echo "Only WSL is supported for now" >&2
exit 1
fi