MicroPythonCommandsInterface: fixed an issue causing the prompt being shown in the REPL pane for each file manager command sequence. micropython

Tue, 30 Jul 2019 19:43:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 30 Jul 2019 19:43:18 +0200
branch
micropython
changeset 7102
5e77aa4671e6
parent 7101
40506ba8680c
child 7103
aea236dc8002

MicroPythonCommandsInterface: fixed an issue causing the prompt being shown in the REPL pane for each file manager command sequence.

eric6/MicroPython/MicroPythonCommandsInterface.py file | annotate | diff | comparison | revisions
--- a/eric6/MicroPython/MicroPythonCommandsInterface.py	Tue Jul 30 19:29:53 2019 +0200
+++ b/eric6/MicroPython/MicroPythonCommandsInterface.py	Tue Jul 30 19:43:18 2019 +0200
@@ -175,7 +175,9 @@
         Private method to switch 'raw' mode off.
         """
         if self.__serial:
-            self.__serial.write(b"\x02")    # send CTRL-B to cancel raw mode
+            self.__serial.write(b"\x02")      # send CTRL-B to cancel raw mode
+            self.__serial.readUntil(b">>> ")  # read until Python prompt
+            self.__serial.readAll()           # read all data and discard it
     
     def execute(self, commands):
         """

eric ide

mercurial