in core/src/com/jediterm/terminal/emulator/JediEmulator.java [131:235]
private void processEscapeSequence(char ch, Terminal terminal) throws IOException {
switch (ch) {
case '[': // Control Sequence Introducer (CSI)
ControlSequence args = new ControlSequence(myDataStream);
if (!args.pushBackReordered(myDataStream)) {
try {
boolean result = processControlSequence(args);
if (LOG.isDebugEnabled()) {
if (result) {
LOG.debug("Control Sequence ({})", args.getDebugInfo());
}
else {
LOG.warn("Unhandled Control Sequence ({})", args.getDebugInfo());
}
}
}
catch (Exception e) {
LOG.error("Error processing Control Sequence ({})", args.getDebugInfo(), e);
}
}
break;
case 'D': //Index (IND)
terminal.index();
break;
case 'E': //Next Line (NEL)
terminal.nextLine();
break;
case 'H': //Horizontal Tab Set (HTS)
terminal.setTabStopAtCursor();
break;
case 'M': // Reverse Index (RI)
terminal.reverseIndex();
break;
case 'N':
terminal.singleShiftSelect(2); //Single Shift Select of G2 Character Set (SS2). This affects next character only.
break;
case 'O':
terminal.singleShiftSelect(3); //Single Shift Select of G3 Character Set (SS3). This affects next character only.
break;
case 'P': // Device Control String (DCS)
SystemCommandSequence command = new SystemCommandSequence(myDataStream);
if (!deviceControlString(command)) {
LOG.warn("Error processing DCS: ESCP" + command);
}
break;
case ']': // Operating System Command (OSC)
processOsc();
break;
case '6':
unsupported("Back Index (DECBI), VT420 and up");
break;
case '7': //Save Cursor (DECSC)
terminal.saveCursor();
break;
case '8':
terminal.restoreCursor();
break;
case '9':
unsupported("Forward Index (DECFI), VT420 and up");
break;
case '=': //Application Keypad (DECKPAM)
setModeEnabled(TerminalMode.Keypad, true);
break;
case '>': //Normal Keypad (DECKPNM)
setModeEnabled(TerminalMode.Keypad, false);
break;
case 'F': //Cursor to lower left corner of the screen
terminal.cursorPosition(1, terminal.getTerminalHeight());
break;
case 'c': // RIS (Reset to Initial State) https://vt100.net/docs/vt510-rm/RIS.html
terminal.reset(true);
break;
case 'n': //Invoke the G2 Character Set as GL - locking shift 2 (LS2)
myTerminal.mapCharsetToGL(2);
break;
case 'o': //Invoke the G3 Character Set as GL - locking shift 3 (LS3)
myTerminal.mapCharsetToGL(3);
break;
case '|': //Invoke the G3 Character Set as GR - locking shift 3, right (LS3R)
myTerminal.mapCharsetToGR(3);
break;
case '}': //Invoke the G2 Character Set as GR - locking shift 2, right (LS2R)
myTerminal.mapCharsetToGR(2);
break;
case '~': //Invoke the G1 Character Set as GR - locking shift 1, right (LS1R)
myTerminal.mapCharsetToGR(1);
break;
case '#':
case '(':
case ')':
case '*':
case '+':
case '$':
case '@':
case '%':
case '.':
case '/':
case ' ':
processTwoCharSequence(ch, terminal);
break;
default:
unsupported(ch);
}
}