private boolean processControlSequence()

in core/src/com/jediterm/terminal/emulator/JediEmulator.java [445:534]


  private boolean processControlSequence(ControlSequence args) {
    switch (args.getFinalChar()) {
      case '@':
        return insertBlankCharacters(args); //ICH
      case 'A':
        return cursorUp(args); //CUU
      case 'B':
        return cursorDown(args); //CUD
      case 'C':
        return cursorForward(args); //CUF
      case 'D':
        return cursorBackward(args); //CUB
      case 'E':
        return cursorNextLine(args); //CNL
      case 'F':
        return cursorPrecedingLine(args); //CPL
      case 'G':
      case '`':
        return cursorHorizontalAbsolute(args); //CHA
      case 'f':
      case 'H': //CUP
        return cursorPosition(args);
      case 'J': //DECSED
        return eraseInDisplay(args);
      case 'K': //EL
        return eraseInLine(args);
      case 'L': //IL
        return insertLines(args);
      case 'M': //DL
        return deleteLines(args);
      case 'X': //ECH
        return eraseCharacters(args);
      case 'P': //DCH
        return deleteCharacters(args);
      case 'S': //SU
        return scrollUp(args);
      case 'T': //SD
        return scrollDown(args);
      case 'c': //Send Device Attributes (Primary DA)
        if (args.startsWithMoreMark()) { //Send Device Attributes (Secondary DA)
          if (args.getArg(0, 0) == 0) { //apply on to VT220 but xterm extends this to VT100
            sendDeviceAttributes();
            return true;
          }
          return false;
        }
        return sendDeviceAttributes();
      case 'd': //VPA
        return linePositionAbsolute(args);
      case 'g': // Tab Clear (TBC)
        return tabClear(args.getArg(0, 0));
      case 'h': //Set Mode (SM) or DEC Private Mode Set (DECSET)
        return setModeOrPrivateMode(args, true);
      case 'l': //Reset Mode (RM) or DEC Private Mode Reset (DECRST)
        return setModeOrPrivateMode(args, false);
      case 'm':
        if (args.startsWithMoreMark()) { //Set or reset resource-values used by xterm
          // to decide whether to construct escape sequences holding information about
          // the modifiers pressed with a given key
          return false;
        }
        if (args.startsWithQuestionMark()) {
          // `CSI ? Pp m` Query key modifier options (XTQMODKEYS), xterm.
          return false;
        }
        return characterAttributes(args); //Character Attributes (SGR)
      case 'n':
        return deviceStatusReport(args); //DSR
      case 'p':
        if (args.startsWithExclamationMark()) {
          // DECSTR (Soft Terminal Reset) https://vt100.net/docs/vt510-rm/DECSTR.html
          myTerminal.reset(false);
          return true;
        }
        return false;
      case 'q':
        return cursorShape(args); //DECSCUSR
      case 'r':
        if (args.startsWithQuestionMark()) {
          return restoreDecPrivateModeValues(args); //
        } else {
          //Set Top and Bottom Margins
          return setScrollingRegion(args); //DECSTBM
        }
      case 't':
        return windowManipulation(args);
      default:
        return false;
    }
  }