--- a/QScintilla/Shell.py Thu Aug 02 18:38:40 2018 +0200 +++ b/QScintilla/Shell.py Sat Sep 01 10:24:02 2018 +0200 @@ -208,7 +208,7 @@ if self.__showStdOutErr: dbs.clientProcessStdout.connect(self.__writeStdOut) dbs.clientProcessStderr.connect(self.__writeStdErr) - dbs.clientOutput.connect(self.__write) + dbs.clientOutput.connect(self.__writeQueued) dbs.clientStatement.connect(self.__clientStatement) dbs.clientGone.connect(self.__initialise) dbs.clientRawInput.connect(self.__raw_input) @@ -906,9 +906,9 @@ line = self.lines() - 1 return (line, len(self.text(line))) - def __write(self, s): + def __writeQueued(self, s): """ - Private method to display some text. + Private method to display some text using a write queue. @param s text to be displayed (string) """ @@ -916,7 +916,7 @@ def __concatenateText(self, text): """ - Private slot to get all available text and process it in one step. + Private slot to queue text and process it in one step. @param text text to be appended @type str @@ -930,16 +930,25 @@ QApplication.processEvents() # Finally process the accumulated text + self.__write(self.__queuedText) + + self.__queuedText = '' + self.__blockTextProcessing = False + + def __write(self, s): + """ + Private method to display some text without queuing. + + @param s text to be displayed + @type str + """ line, col = self.__getEndPos() self.setCursorPosition(line, col) - self.insert(Utilities.filterAnsiSequences(self.__queuedText)) + self.insert(Utilities.filterAnsiSequences(s)) self.prline, self.prcol = self.getCursorPosition() self.ensureCursorVisible() self.ensureLineVisible(self.prline) - self.__queuedText = '' - self.__blockTextProcessing = False - def __writeStdOut(self, s): """ Private method to display some text with StdOut label. @@ -963,6 +972,9 @@ @param s prompt to be displayed (string) @param echo Flag indicating echoing of the input (boolean) """ + # Get all text which is still waiting for output + QApplication.processEvents() + self.setFocus() self.inRawMode = True self.echoInput = echo