From 2b6190e7efec51fc5ffc828c09c8cf1e1834fefc Mon Sep 17 00:00:00 2001 From: Pavel Karateev Date: Sat, 7 Oct 2023 13:41:39 +0200 Subject: [PATCH 1/2] Switch to 232 --- gradle.properties | 5 ++--- src/main/resources/META-INF/plugin.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index b8b93c52..c3769f59 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,4 @@ version=SNAPSHOT -#ideaVersion=IC-202-EAP-SNAPSHOT -ideaVersion=PC-231-EAP-SNAPSHOT -pythonPlugin=PythonCore:231.8109.144 +ideaVersion=PC-232-EAP-SNAPSHOT +pythonPlugin=PythonCore:232.9921.47 publishToken=token diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index b7de2732..b895f54b 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -25,7 +25,7 @@ com.intellij.modules.python org.jetbrains.plugins.terminal - + Date: Sat, 7 Oct 2023 13:43:07 +0200 Subject: [PATCH 2/2] Fix REPL Switch from the deprecated `TerminalProcessOptions` to `ShellStartupOptions` new API --- .../repl/MicroPythonReplManager.kt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/jetbrains/micropython/repl/MicroPythonReplManager.kt b/src/main/kotlin/com/jetbrains/micropython/repl/MicroPythonReplManager.kt index 0250f6b2..8309bd01 100644 --- a/src/main/kotlin/com/jetbrains/micropython/repl/MicroPythonReplManager.kt +++ b/src/main/kotlin/com/jetbrains/micropython/repl/MicroPythonReplManager.kt @@ -7,7 +7,7 @@ import com.jetbrains.micropython.settings.MicroPythonFacet import com.jetbrains.micropython.settings.microPythonFacet import com.pty4j.PtyProcess import org.jetbrains.plugins.terminal.LocalTerminalDirectRunner -import org.jetbrains.plugins.terminal.TerminalProcessOptions +import org.jetbrains.plugins.terminal.ShellStartupOptions interface CommsEventListener { fun onProcessStarted(ttyConnector: TtyConnector) @@ -45,13 +45,15 @@ class MicroPythonReplManager(module: Module) { return } + val initialShellCommand = mutableListOf( + facet.pythonPath!!, + "${MicroPythonFacet.scriptsPath}/microrepl.py", + devicePath + ) + val terminalRunner = object : LocalTerminalDirectRunner(currentModule.project) { override fun getInitialCommand(envs: MutableMap): MutableList { - return mutableListOf( - facet.pythonPath!!, - "${MicroPythonFacet.scriptsPath}/microrepl.py", - devicePath - ) + return initialShellCommand } fun getTtyConnector(process: PtyProcess): TtyConnector { @@ -60,8 +62,11 @@ class MicroPythonReplManager(module: Module) { } synchronized(this) { - val terminalOptions = TerminalProcessOptions(null, null, null) - val process = terminalRunner.createProcess(terminalOptions, null) + val terminalOptions = ShellStartupOptions.Builder() + .workingDirectory(devicePath) + .shellCommand(initialShellCommand) + .build() + val process = terminalRunner.createProcess(terminalOptions) val ttyConnector = terminalRunner.getTtyConnector(process) currentProcess = process