src/core/CliConsole.js
// Handle saving of the text line stack.
Handle saving of the text line stack.
Handle saving of the text line stack .
function saveInput(currentInput) {
      if (self.pwdMode) {
        return false;
      }
      currentSavedInputIndex = 0;
      var textLine = currentInput.textLine;
      if (currentInput.multiLine) {
        return false;
      }
      if (textLine.length === 0) {
       return false;
      }
      if (self.saveOnlyUnique) {
        if (_.includes(self.savedInputLines, textLine)) {
         return false;
        }
      }
      if (self.savedInputLines.length > 0 &&
        self.savedInputLines[0] === textLine) 
      {
        return false;
      }
      self.savedInputLines.unshift(textLine); 
      return true;
    }
function saveInput ( currentInput ) { if ( self . pwdMode ) { return false ; } currentSavedInputIndex = 0 ; var textLine = currentInput . textLine ; if ( currentInput . multiLine ) { return false ; } if ( textLine . length === 0 ) { return false ; } if ( self . saveOnlyUnique ) { if ( _ . includes ( self . savedInputLines , textLine ) ) { return false ; } } if ( self . savedInputLines . length > 0 && self . savedInputLines [ 0 ] === textLine ) { return false ; } self . savedInputLines . unshift ( textLine ) ; return true ; }
Handle saving of the text line stack.
Handle saving of the text line stack .
// Passwords are never saved. // Only single lines are saved in the stack. // Lines must be at least 2 characters long to be worth saving. // Only unique lines are saved in the stack. // Do not save two duplicate lines in a row. // stick it in the stack.