--- a/src/eric7/QScintilla/Shell.py Wed Feb 07 15:30:12 2024 +0100 +++ b/src/eric7/QScintilla/Shell.py Fri Feb 09 18:58:42 2024 +0100 @@ -12,6 +12,7 @@ import pathlib import re import sys +import time from PyQt6.Qsci import QsciScintilla from PyQt6.QtCore import QEvent, QPoint, Qt, pyqtSignal, pyqtSlot @@ -1925,11 +1926,7 @@ # Display the banner. self.__getBanner() elif cmd in ["%reset", "%restart"]: - self.dbs.startClient( - False, - venvName=self.__currentVenv, - workingDir=self.__currentWorkingDirectory, - ) + self.doRestart() elif cmd in ["%envs", "%environments"]: venvs = ( ericApp().getObject("VirtualEnvManager").getVirtualenvNames() @@ -1981,7 +1978,9 @@ self.setFocus(Qt.FocusReason.OtherFocusReason) else: self.dbs.remoteStatement(self.__getSelectedDebuggerId(), cmd) - while self.inCommandExecution: + now = time.monotonic() + while self.inCommandExecution and time.monotonic() - now < 10: + # 10 seconds timeout with contextlib.suppress(KeyboardInterrupt): QApplication.processEvents() else: