--- a/QScintilla/Shell.py Wed Jan 24 18:45:50 2018 +0100 +++ b/QScintilla/Shell.py Wed Jan 24 19:08:08 2018 +0100 @@ -1660,7 +1660,7 @@ self.__setHistoryIndex(index=-1) elif self.__historyStyle == ShellHistoryStyle.WindowsStyle: if historyIndex is None: - if bool(self.__histidx - 1) and \ + if self.__histidx - 1 > 0 and \ cmd != self.__history[self.__histidx - 1]: self.__setHistoryIndex(index=-1) else: