From 1223b22ffd0a94199a3edc0f14672c4c30bcb1e5 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 9 Mar 2023 19:19:30 +0100 Subject: [PATCH] WSL2: Ensure the Windows Terminal is detected under WSL2 docker build. (#4915) - by passing the WT_SESSION environment variable into the docker container if it is set --- lib/functions/host/docker.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/functions/host/docker.sh b/lib/functions/host/docker.sh index 00dea07709..37c28c254a 100755 --- a/lib/functions/host/docker.sh +++ b/lib/functions/host/docker.sh @@ -460,6 +460,11 @@ function docker_cli_prepare_launch() { fi fi + # If set, pass down the Windows Terminal Session, so the existance of Windows Terminal can be detected later + if [[ -n "${WT_SESSION}" ]]; then + DOCKER_ARGS+=("--env" "WT_SESSION=${WT_SESSION}") + fi + # This will receive the mountpoint as $1 and the mountpoint vars in the environment. function prepare_docker_args_for_mountpoint() { local MOUNT_DIR="$1"