--- a/eric6/QScintilla/Shell.py Sun Feb 02 11:37:08 2020 +0100 +++ b/eric6/QScintilla/Shell.py Sun Feb 02 13:01:55 2020 +0100 @@ -992,6 +992,12 @@ QApplication.processEvents() # Finally process the accumulated text + self.__flushQueuedText() + + def __flushQueuedText(self): + """ + Private slot to flush the accumulated text output. + """ self.__write(self.__queuedText) self.__queuedText = '' @@ -1000,7 +1006,7 @@ # little trick to get the cursor position registered within QScintilla self.SendScintilla(QsciScintilla.SCI_CHARLEFT) self.SendScintilla(QsciScintilla.SCI_CHARRIGHT) - + def __write(self, s): """ Private method to display some text without queuing. @@ -1031,20 +1037,24 @@ """ self.__write(self.tr("StdErr: {0}").format(s)) - def __raw_input(self, s, echo): + def __raw_input(self, prompt, echo): """ Private method to handle raw input. - @param s prompt to be displayed (string) - @param echo Flag indicating echoing of the input (boolean) + @param prompt prompt to be displayed + @type str + @param echo Flag indicating echoing of the input + @type bool """ - # Get all text which is still waiting for output - QApplication.processEvents() - self.setFocus() self.inRawMode = True self.echoInput = echo - self.__writeQueued(s) + + # Get all text which is still waiting for output + QApplication.processEvents() + self.__flushQueuedText() + + self.__write(prompt) line, col = self.__getEndPos() self.setCursorPosition(line, col) buf = self.text(line)