package com.termux.terminal; /** "\033[" is the Control Sequence Introducer char sequence (CSI). */ public class ControlSequenceIntroducerTest extends TerminalTestCase { /** CSI Ps P Scroll down Ps lines (default = 1) (SD). */ public void testCsiT() { withTerminalSized(4, 6).enterString("1\r\n2\r\n3\r\nhi\033[2Tyo\r\nA\r\nB").assertLinesAre(" ", " ", "1 ", "2 yo", "A ", "Bi "); // Default value (1): withTerminalSized(4, 6).enterString("1\r\n2\r\n3\r\nhi\033[Tyo\r\nA\r\nB").assertLinesAre(" ", "1 ", "2 ", "3 yo", "Ai ", "B "); } /** CSI Ps S Scroll up Ps lines (default = 1) (SU). */ public void testCsiS() { // The behaviour here is a bit inconsistent between terminals - this is how the OS X Terminal.app does it: withTerminalSized(3, 4).enterString("1\r\n2\r\n3\r\nhi\033[2Sy").assertLinesAre("3 ", "hi ", " ", " y"); // Default value (1): withTerminalSized(3, 4).enterString("1\r\n2\r\n3\r\nhi\033[Sy").assertLinesAre("2 ", "3 ", "hi ", " y"); } }