From 562cf4e640541e44615cabb17be0e961b85ebb1b Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Thu, 17 Jan 2019 15:23:46 +0300 Subject: [PATCH] RUBY-20358 Added experimental feature for closing WSL process stdin (disabled by default) IDEA-CR-42215 --- .../src/com/intellij/execution/wsl/WSLUtil.java | 8 ++++++-- .../src/META-INF/PlatformExtensions.xml | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/execution/wsl/WSLUtil.java b/platform/platform-impl/src/com/intellij/execution/wsl/WSLUtil.java index 95e6cbddd20e..5be9376d48a3 100644 --- a/platform/platform-impl/src/com/intellij/execution/wsl/WSLUtil.java +++ b/platform/platform-impl/src/com/intellij/execution/wsl/WSLUtil.java @@ -10,6 +10,7 @@ import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -122,10 +123,13 @@ public class WSLUtil { * Temporary hack method to fix WSL bug * Must be invoked just before execution, see RUBY-20358 */ + @ApiStatus.ScheduledForRemoval(inVersion = "2019.2") @NotNull public static T addInputCloseListener(@NotNull T processHandler) { - processHandler.removeProcessListener(INPUT_CLOSE_LISTENER); - processHandler.addProcessListener(INPUT_CLOSE_LISTENER); + if (Experiments.isFeatureEnabled("wsl.close.process.input")) { + processHandler.removeProcessListener(INPUT_CLOSE_LISTENER); + processHandler.addProcessListener(INPUT_CLOSE_LISTENER); + } return processHandler; } diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index d805ffc0ba46..aaec99c0bef2 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -13,6 +13,12 @@ + + Forces closing of WSL process input stream to prevent process zombification. See + https://github.com/Microsoft/WSL/issues/2592 + Required for Windows 10 version prior 1803 + +