code: function _resetReadLine(state) {
      if (state.rl) {
          state.rl.close();
      }
  
      state.rl = readline.createInterface({
          'input': state.input,
          'output': state.output,
          'completer': function(line, callback) {
              if (!_.isFunction(state.autocomplete)) {
                  // No autocomplete was provided, do nothing
                  return callback(null, [[], line]);
              }
  
              CommandAutocomplete.getAutocompleteArguments(state.currentCommand, line, function(abort, args) {
                  if (abort) {
                      return callback(null, [[], line]);
                  }
  
                  state.autocomplete(args, function(err, replacements) {
                      if (err) {
                          return callback(err);
                      }
  
                      CommandAutocomplete.getAutocompleteReplacements(state.currentCommand, line, replacements, function(replacements, toReplace) {
                          // Convert the arguments into what node-readline expects
                          return callback(null, [replacements, toReplace]);
                      });
                  });
              });
          }
      });
  
      /*!
       * Monkey-patch the setPrompt method to properly calculate the string length when colors are
       * used. :(
       *
       * http://stackoverflow.com/questions/12075396/adding-colors-to-terminal-prompt-results-in-large-white-space
       */
      var rl = state.rl;
      rl._setPrompt = rl.setPrompt;
      rl.setPrompt = function(prompt, length) {
          var strippedLength = null;
          if (length) {
              strippedLength = length;
          } else {
              var stripped = prompt.split(/[\r\n]/).pop().stripColors;
              if (stripped) {
                  strippedLength = stripped.length;
              }
          }
  
          rl._setPrompt(prompt, strippedLength);
      };
  
      _bindSigint(state);
  }
docs: /*!
  Reset the state of the readline instance to get a new prompt