docs: def add_command(self, command):
          """
          Adds a command to the history and reset history index.
          """
          try:
              self._history.remove(command)
          except ValueError:
              pass
          self._history.insert(0, command)
          self._index = -1