--- a/src/eric7/QScintilla/Shell.py Thu Nov 02 11:26:51 2023 +0100 +++ b/src/eric7/QScintilla/Shell.py Thu Nov 02 13:36:44 2023 +0100 @@ -259,6 +259,7 @@ self.inDragDrop = False self.lexer_ = None self.completionText = "" + self.__shuttingDown = False self.clientType = "" @@ -404,6 +405,7 @@ """ for clientType in self.__historyLists: self.saveHistory(clientType) + self.__shuttingDown = True def __bindLexer(self, language="Python3"): """ @@ -2546,7 +2548,7 @@ """ Private slot to restart the default shell when the project is closed. """ - if Preferences.getProject("RestartShellForProject"): + if not self.__shuttingDown and Preferences.getProject("RestartShellForProject"): self.dbs.startClient(False) self.__getBanner()