code: protected void addToHistory (String cmd)
      {
          // remove any previous instance of this command
          _history.remove(cmd);
  
          // append it to the end
          _history.add(cmd);
  
          // prune the history once it extends beyond max size
          if (_history.size() > MAX_COMMAND_HISTORY) {
              _history.remove(0);
          }
      }
docs: Adds the specified command to the history.