Skip to content

Commit

Permalink
Merge branch 'master' into fix_underline
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed May 27, 2019
2 parents 96b3eb9 + 5276ad8 commit 030fb78
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 49 deletions.
24 changes: 0 additions & 24 deletions bin/prepare-release

This file was deleted.

22 changes: 0 additions & 22 deletions bin/release

This file was deleted.

2 changes: 1 addition & 1 deletion src/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class Buffer implements IBuffer {
for (let y = this.lines.length - 1; y >= 0; y--) {
// Check whether this line is a problem
let nextLine = this.lines.get(y) as BufferLine;
if (!nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {
if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {
continue;
}

Expand Down
60 changes: 59 additions & 1 deletion src/InputHandler.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const width = 800;
const height = 600;

describe('InputHandler Integration Tests', function(): void {
this.timeout(10000);
this.timeout(20000);

before(async function(): Promise<any> {
browser = await puppeteer.launch({
Expand Down Expand Up @@ -138,6 +138,64 @@ describe('InputHandler Integration Tests', function(): void {
assert.deepEqual(await getLinesAsArray(2), [' a', ' b']);
});

it('ED: Erase in Display, VT100 - CSI Ps J', async function(): Promise<any> {
const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H';
await page.evaluate(`
// Default: Erase Below
window.term.resize(5, 5);
window.term.write('${fixture}\x1b[J')
`);
assert.deepEqual(await getLinesAsArray(3), ['abc', 'd', '']);
await page.evaluate(`
// 0: Erase Below
window.term.reset()
window.term.write('${fixture}\x1b[0J')
`);
assert.deepEqual(await getLinesAsArray(3), ['abc', 'd', '']);
await page.evaluate(`
// 1: Erase Above
window.term.reset()
window.term.write('${fixture}\x1b[1J')
`);
assert.deepEqual(await getLinesAsArray(3), ['', ' f', 'ghi']);
await page.evaluate(`
// 2: Erase Saved Lines (scrollback)
window.term.reset()
window.term.write('1\\n2\\n3\\n4\\n5${fixture}\x1b[3J')
`);
assert.equal(await page.evaluate(`window.term.buffer.length`), 5);
assert.deepEqual(await getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']);
});

it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function(): Promise<any> {
const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H';
await page.evaluate(`
// Default: Erase Below
window.term.resize(5, 5);
window.term.write('${fixture}\x1b[?J')
`);
assert.deepEqual(await getLinesAsArray(3), ['abc', 'd', '']);
await page.evaluate(`
// 0: Erase Below
window.term.reset()
window.term.write('${fixture}\x1b[?0J')
`);
assert.deepEqual(await getLinesAsArray(3), ['abc', 'd', '']);
await page.evaluate(`
// 1: Erase Above
window.term.reset()
window.term.write('${fixture}\x1b[?1J')
`);
assert.deepEqual(await getLinesAsArray(3), ['', ' f', 'ghi']);
await page.evaluate(`
// 2: Erase Saved Lines (scrollback)
window.term.reset()
window.term.write('1\\n2\\n3\\n4\\n5${fixture}\x1b[?3J')
`);
assert.equal(await page.evaluate(`window.term.buffer.length`), 5);
assert.deepEqual(await getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']);
});

describe('DSR: Device Status Report', () => {
it('Status Report - CSI 5 n', async function(): Promise<any> {
await page.evaluate(`
Expand Down
2 changes: 1 addition & 1 deletion src/public/Terminal.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const width = 800;
const height = 600;

describe('API Integration Tests', function(): void {
this.timeout(10000);
this.timeout(20000);

before(async function(): Promise<any> {
browser = await puppeteer.launch({
Expand Down

0 comments on commit 030fb78

Please sign in to comment.