diff --git a/platform/eel-impl/src/com/intellij/platform/eel/impl/local/EelLocalExecApi.kt b/platform/eel-impl/src/com/intellij/platform/eel/impl/local/EelLocalExecApi.kt index 49da0760f336..0bb8b187aebc 100644 --- a/platform/eel-impl/src/com/intellij/platform/eel/impl/local/EelLocalExecApi.kt +++ b/platform/eel-impl/src/com/intellij/platform/eel/impl/local/EelLocalExecApi.kt @@ -295,10 +295,11 @@ private fun executeImpl(builder: EelExecApi.ExecuteProcessOptions): Process { // Inherit env vars because lack of `PATH` might break things val environment = System.getenv().toMutableMap() environment.putAll(builder.env) - val escapedCommandLine = CommandLineUtil.toCommandLine(builder.exe, builder.args, Platform.current()) + val platform = Platform.current() + val escapedCommandLine = CommandLineUtil.toCommandLine(builder.exe, builder.args, platform) return when (val p = pty) { is EelExecApi.Pty -> { - if ("TERM" !in environment) { + if (platform == Platform.UNIX && "TERM" !in environment) { environment.getOrPut("TERM") { "xterm" } } LocalProcessService.getInstance().startPtyProcess( diff --git a/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt b/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt index c6a980029ea0..bff68d694c9b 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt @@ -13,6 +13,7 @@ import com.intellij.openapi.util.SystemInfoRt import com.intellij.platform.eel.* import com.intellij.platform.eel.EelExecApi.Pty import com.intellij.platform.eel.impl.local.getShellFromPasswdRecords +import com.intellij.platform.eel.provider.LocalEelDescriptor import com.intellij.platform.eel.provider.localEel import com.intellij.platform.eel.provider.utils.sendWholeText import com.intellij.platform.tests.eelHelpers.EelHelper @@ -179,8 +180,10 @@ class EelLocalExecApiTest { PTY_SIZE_FROM_START, PTY_RESIZE_LATER -> { Assertions.assertNotNull(ttyState.size) Assertions.assertEquals(Size(PTY_COLS, PTY_ROWS), ttyState.size, "size must be set for tty") - val expectedTerm = System.getenv("TERM") ?: "xterm" - Assertions.assertEquals(expectedTerm, ttyState.termName, "Wrong term type") + if (LocalEelDescriptor.osFamily.isPosix) { + val expectedTerm = System.getenv("TERM") ?: "xterm" + Assertions.assertEquals(expectedTerm, ttyState.termName, "Wrong term type") + } } NO_PTY -> { Assertions.assertNull(ttyState.size, "size must not be set if no tty")