Skip to content

Commit 41cc99a

Browse files
committed
DECSTBM SU/SD
1 parent e2366fa commit 41cc99a

File tree

3 files changed

+42
-20
lines changed

3 files changed

+42
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
a
2-
b
3-
c
4-
d
5-
f
6-
g
7-
h
8-
i
2+
b
3+
c
4+
d
5+
f
6+
g
7+
h
8+
i
99

10-
j
11-
k
12-
l
13-
m
10+
j
11+
k
12+
l
13+
m
1414

1515

1616

17-
n
18-
o
19-
p
20-
q
21-
r
22-
s
23-
w
24-
x
17+
n
18+
o
19+
p
20+
q
21+
r
22+
s
23+
w
24+
x
25+

src/InputHandler.test.ts

+21
Original file line numberDiff line numberDiff line change
@@ -1105,4 +1105,25 @@ describe('InputHandler', () => {
11051105
assert.equal(term.buffer.scrollBottom, 9);
11061106
});
11071107
});
1108+
describe('scrolling', () => {
1109+
let term: TestTerminal;
1110+
beforeEach(() => {
1111+
term = new TestTerminal({cols: 10, rows: 10});
1112+
});
1113+
function getLines(term: TestTerminal, limit: number = term.rows): string[] {
1114+
const res: string[] = [];
1115+
for (let i = 0; i < limit; ++i) {
1116+
res.push(term.buffer.lines.get(i).translateToString(true));
1117+
}
1118+
return res;
1119+
}
1120+
it('scrollUp with margins', () => {
1121+
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');
1122+
assert.deepEqual(getLines(term), ['m', '3', '', '', '4', '5', '6', '7', '8', '9']);
1123+
});
1124+
it('scrollDown with margins', () => {
1125+
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');
1126+
assert.deepEqual(getLines(term), ['m', '', '', '1', '4', '5', '6', '7', '8', '9']);
1127+
});
1128+
});
11081129
});

src/Terminal2.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ if (os.platform() !== 'win32') {
122122
't0070-DECSTBM_LF.in',
123123
't0071-DECSTBM_IND.in',
124124
't0072-DECSTBM_NEL.in',
125-
't0074-DECSTBM_SU_SD.in',
125+
// 't0074-DECSTBM_SU_SD.in',
126126
't0075-DECSTBM_CUU_CUD.in',
127127
't0076-DECSTBM_IL_DL.in',
128128
't0077-DECSTBM_quirks.in',

0 commit comments

Comments
 (0)