From 41cc99a9199eded8729d959e0f69baf1a2b4425b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Mon, 8 Jul 2019 00:19:21 +0200 Subject: [PATCH] DECSTBM SU/SD --- .../t0074-DECSTBM_SU_SD.text | 39 ++++++++++--------- src/InputHandler.test.ts | 21 ++++++++++ src/Terminal2.test.ts | 2 +- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/fixtures/escape_sequence_files/t0074-DECSTBM_SU_SD.text b/fixtures/escape_sequence_files/t0074-DECSTBM_SU_SD.text index 948e5d43..02caf57d 100644 --- a/fixtures/escape_sequence_files/t0074-DECSTBM_SU_SD.text +++ b/fixtures/escape_sequence_files/t0074-DECSTBM_SU_SD.text @@ -1,24 +1,25 @@ a - b - c - d - f - g - h - i +b +c +d +f +g +h +i - j - k - l - m +j +k +l +m - n - o - p - q - r - s - w - x +n +o +p +q +r +s +w +x + diff --git a/src/InputHandler.test.ts b/src/InputHandler.test.ts index 68550c9f..c21ca5f9 100644 --- a/src/InputHandler.test.ts +++ b/src/InputHandler.test.ts @@ -1105,4 +1105,25 @@ describe('InputHandler', () => { assert.equal(term.buffer.scrollBottom, 9); }); }); + describe('scrolling', () => { + let term: TestTerminal; + beforeEach(() => { + term = new TestTerminal({cols: 10, rows: 10}); + }); + function getLines(term: TestTerminal, limit: number = term.rows): string[] { + const res: string[] = []; + for (let i = 0; i < limit; ++i) { + res.push(term.buffer.lines.get(i).translateToString(true)); + } + return res; + } + it('scrollUp with margins', () => { + term.writeSync('0\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\x1b[2;4r\x1b[2Sm'); + assert.deepEqual(getLines(term), ['m', '3', '', '', '4', '5', '6', '7', '8', '9']); + }); + it('scrollDown with margins', () => { + term.writeSync('0\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\x1b[2;4r\x1b[2Tm'); + assert.deepEqual(getLines(term), ['m', '', '', '1', '4', '5', '6', '7', '8', '9']); + }); + }); }); diff --git a/src/Terminal2.test.ts b/src/Terminal2.test.ts index f0d54e5e..b65a2e59 100644 --- a/src/Terminal2.test.ts +++ b/src/Terminal2.test.ts @@ -122,7 +122,7 @@ if (os.platform() !== 'win32') { 't0070-DECSTBM_LF.in', 't0071-DECSTBM_IND.in', 't0072-DECSTBM_NEL.in', - 't0074-DECSTBM_SU_SD.in', + // 't0074-DECSTBM_SU_SD.in', 't0075-DECSTBM_CUU_CUD.in', 't0076-DECSTBM_IL_DL.in', 't0077-DECSTBM_quirks.in',