@Test public void testPipe_control_lcLetters() { String expected = "\u001bO"; String input = "~"; int i; for (i = 0; i < 4; i++) { if (i < lcLetters.length && i < esc_first4.length) { assertEquals(expected + esc_first4[i], term.pipe(input + lcLetters[i])); } } expected = "\u001b["; for (int j = 0; j < lcLetters.length; j++) { if (j < esc_last8.length) { assertEquals(expected + esc_last8[j], term.pipe(input + lcLetters[j+i])); } } }
public synchronized String pipe(String d) { String o = ""; for (char c : d.toCharArray()) { if (vt100_keyfilter_escape) { vt100_keyfilter_escape = false; if (vt100_mode_cursorkey) { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001bOA"; break; case 'B': o += "\u001bOB"; break; case 'C': o += "\u001bOC"; break; case 'D': o += "\u001bOD"; break; case 'F': o += "\u001bOF"; break; case 'H': o += "\u001bOH"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } else { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001b[A"; break; case 'B': o += "\u001b[B"; break; case 'C': o += "\u001b[C"; break; case 'D': o += "\u001b[D"; break; case 'F': o += "\u001b[F"; break; case 'H': o += "\u001b[H"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } } else if (c == '~') { vt100_keyfilter_escape = true; } else if (c == 127) { if (vt100_mode_backspace) { o += (char) 8; } else { o += (char) 127; } } else { o += c; if (vt100_mode_lfnewline && c == 13) { o += (char) 10; } } } return o; }
Terminal { public synchronized String pipe(String d) { String o = ""; for (char c : d.toCharArray()) { if (vt100_keyfilter_escape) { vt100_keyfilter_escape = false; if (vt100_mode_cursorkey) { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001bOA"; break; case 'B': o += "\u001bOB"; break; case 'C': o += "\u001bOC"; break; case 'D': o += "\u001bOD"; break; case 'F': o += "\u001bOF"; break; case 'H': o += "\u001bOH"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } else { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001b[A"; break; case 'B': o += "\u001b[B"; break; case 'C': o += "\u001b[C"; break; case 'D': o += "\u001b[D"; break; case 'F': o += "\u001b[F"; break; case 'H': o += "\u001b[H"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } } else if (c == '~') { vt100_keyfilter_escape = true; } else if (c == 127) { if (vt100_mode_backspace) { o += (char) 8; } else { o += (char) 127; } } else { o += c; if (vt100_mode_lfnewline && c == 13) { o += (char) 10; } } } return o; } }
Terminal { public synchronized String pipe(String d) { String o = ""; for (char c : d.toCharArray()) { if (vt100_keyfilter_escape) { vt100_keyfilter_escape = false; if (vt100_mode_cursorkey) { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001bOA"; break; case 'B': o += "\u001bOB"; break; case 'C': o += "\u001bOC"; break; case 'D': o += "\u001bOD"; break; case 'F': o += "\u001bOF"; break; case 'H': o += "\u001bOH"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } else { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001b[A"; break; case 'B': o += "\u001b[B"; break; case 'C': o += "\u001b[C"; break; case 'D': o += "\u001b[D"; break; case 'F': o += "\u001b[F"; break; case 'H': o += "\u001b[H"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } } else if (c == '~') { vt100_keyfilter_escape = true; } else if (c == 127) { if (vt100_mode_backspace) { o += (char) 8; } else { o += (char) 127; } } else { o += c; if (vt100_mode_lfnewline && c == 13) { o += (char) 10; } } } return o; } Terminal();  Terminal(int width, int height); }
Terminal { public synchronized String pipe(String d) { String o = ""; for (char c : d.toCharArray()) { if (vt100_keyfilter_escape) { vt100_keyfilter_escape = false; if (vt100_mode_cursorkey) { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001bOA"; break; case 'B': o += "\u001bOB"; break; case 'C': o += "\u001bOC"; break; case 'D': o += "\u001bOD"; break; case 'F': o += "\u001bOF"; break; case 'H': o += "\u001bOH"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } else { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001b[A"; break; case 'B': o += "\u001b[B"; break; case 'C': o += "\u001b[C"; break; case 'D': o += "\u001b[D"; break; case 'F': o += "\u001b[F"; break; case 'H': o += "\u001b[H"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } } else if (c == '~') { vt100_keyfilter_escape = true; } else if (c == 127) { if (vt100_mode_backspace) { o += (char) 8; } else { o += (char) 127; } } else { o += c; if (vt100_mode_lfnewline && c == 13) { o += (char) 10; } } } return o; } Terminal();  Terminal(int width, int height); synchronized boolean setSize(int w, int h); synchronized String read(); synchronized String pipe(String d); synchronized boolean write(String d); synchronized String dump(); String toString(); }
Terminal { public synchronized String pipe(String d) { String o = ""; for (char c : d.toCharArray()) { if (vt100_keyfilter_escape) { vt100_keyfilter_escape = false; if (vt100_mode_cursorkey) { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001bOA"; break; case 'B': o += "\u001bOB"; break; case 'C': o += "\u001bOC"; break; case 'D': o += "\u001bOD"; break; case 'F': o += "\u001bOF"; break; case 'H': o += "\u001bOH"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } else { switch (c) { case '~': o += "~"; break; case 'A': o += "\u001b[A"; break; case 'B': o += "\u001b[B"; break; case 'C': o += "\u001b[C"; break; case 'D': o += "\u001b[D"; break; case 'F': o += "\u001b[F"; break; case 'H': o += "\u001b[H"; break; case '1': o += "\u001b[5~"; break; case '2': o += "\u001b[6~"; break; case '3': o += "\u001b[2~"; break; case '4': o += "\u001b[3~"; break; case 'a': o += "\u001bOP"; break; case 'b': o += "\u001bOQ"; break; case 'c': o += "\u001bOR"; break; case 'd': o += "\u001bOS"; break; case 'e': o += "\u001b[15~"; break; case 'f': o += "\u001b[17~"; break; case 'g': o += "\u001b[18~"; break; case 'h': o += "\u001b[19~"; break; case 'i': o += "\u001b[20~"; break; case 'j': o += "\u001b[21~"; break; case 'k': o += "\u001b[23~"; break; case 'l': o += "\u001b[24~"; break; } } } else if (c == '~') { vt100_keyfilter_escape = true; } else if (c == 127) { if (vt100_mode_backspace) { o += (char) 8; } else { o += (char) 127; } } else { o += c; if (vt100_mode_lfnewline && c == 13) { o += (char) 10; } } } return o; } Terminal();  Terminal(int width, int height); synchronized boolean setSize(int w, int h); synchronized String read(); synchronized String pipe(String d); synchronized boolean write(String d); synchronized String dump(); String toString();  }