--- a/QScintilla/Shell.py Sun Nov 19 13:06:01 2017 +0100 +++ b/QScintilla/Shell.py Sat Dec 02 12:40:22 2017 +0100 @@ -1603,7 +1603,8 @@ self.__setHistoryIndex(index=-1) elif self.__historyStyle == ShellHistoryStyle.WindowsStyle: if historyIndex is None: - if cmd != self.__history[self.__histidx - 1]: + if bool(self.__histidx - 1) and \ + cmd != self.__history[self.__histidx - 1]: self.__setHistoryIndex(index=-1) else: self.__setHistoryIndex(historyIndex)