diff --git a/fixtures/escape_sequence_files/t0070-DECSTBM_LF.in b/fixtures/escape_sequence_files/t0070-DECSTBM_LF.in index 571f2233..c56b99a0 100644 --- a/fixtures/escape_sequence_files/t0070-DECSTBM_LF.in +++ b/fixtures/escape_sequence_files/t0070-DECSTBM_LF.in @@ -27,5 +27,5 @@ r s t uvwxyz - + The end. diff --git a/fixtures/escape_sequence_files/t0070-DECSTBM_LF.text b/fixtures/escape_sequence_files/t0070-DECSTBM_LF.text index 0940b073..940bc86d 100644 --- a/fixtures/escape_sequence_files/t0070-DECSTBM_LF.text +++ b/fixtures/escape_sequence_files/t0070-DECSTBM_LF.text @@ -1,25 +1,25 @@ -1 - 2 - 6 - 7 - 8 - 9 ABC +6 +7 +8 +9 ABC DEF a - b - c - d - e - f - g - h - i - j - k - l - m - n - o - p -yz qrstu vwx +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +yz vwx The end. + diff --git a/src/InputHandler.ts b/src/InputHandler.ts index f47085d4..0b011e34 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -412,10 +412,13 @@ export class InputHandler extends Disposable implements IInputHandler { if (wraparoundMode) { buffer.x = 0; buffer.y++; - if (buffer.y > buffer.scrollBottom) { + if (buffer.y === buffer.scrollBottom + 1) { buffer.y--; this._terminal.scroll(true); } else { + if (buffer.y >= this._bufferService.rows) { + buffer.y = this._bufferService.rows - 1; + } // The line already exists (eg. the initial viewport), mark it as a // wrapped line buffer.lines.get(buffer.y).isWrapped = true; @@ -508,9 +511,11 @@ export class InputHandler extends Disposable implements IInputHandler { buffer.x = 0; } buffer.y++; - if (buffer.y > buffer.scrollBottom) { + if (buffer.y === buffer.scrollBottom + 1) { buffer.y--; this._terminal.scroll(); + } else if (buffer.y >= this._bufferService.rows) { + buffer.y = this._bufferService.rows - 1; } // If the end of the line is hit, prevent this action from wrapping around to the next line. if (buffer.x >= this._bufferService.cols) { diff --git a/src/Terminal2.test.ts b/src/Terminal2.test.ts index cbd790d5..05018f0f 100644 --- a/src/Terminal2.test.ts +++ b/src/Terminal2.test.ts @@ -17,7 +17,7 @@ const ROWS = 25; const TESTFILES = glob.sync('**/escape_sequence_files/*.in', { cwd: path.join(__dirname, '..')}); const SKIP_FILES = [ - 't0070-DECSTBM_LF.in', // lineFeed not working correctly + // 't0070-DECSTBM_LF.in', // lineFeed not working correctly 't0071-DECSTBM_IND.in', 't0072-DECSTBM_NEL.in', 't0075-DECSTBM_CUU_CUD.in', @@ -42,7 +42,7 @@ const FILES = TESTFILES.filter(value => SKIP_FILES.indexOf(value.split('/').slic describe('Escape Sequence Files', function(): void { - this.timeout(20000); + this.timeout(100); let ptyTerm: any; let slaveEnd: any;