diff --git a/fixtures/escape_sequence_files/t0071-DECSTBM_IND.in b/fixtures/escape_sequence_files/t0071-DECSTBM_IND.in index f9f6a424..a6aa1810 100644 --- a/fixtures/escape_sequence_files/t0071-DECSTBM_IND.in +++ b/fixtures/escape_sequence_files/t0071-DECSTBM_IND.in @@ -1,3 +1,3 @@ 1D2D3D4D5D6D7D8D9ABCDEFaDbDcDdDeDfDgDhDiDjDkDlDmDnDoDpDqDrDsDtDuvwxyz - + The end. diff --git a/fixtures/escape_sequence_files/t0071-DECSTBM_IND.text b/fixtures/escape_sequence_files/t0071-DECSTBM_IND.text index f6644fb5..bc7344f9 100644 --- a/fixtures/escape_sequence_files/t0071-DECSTBM_IND.text +++ b/fixtures/escape_sequence_files/t0071-DECSTBM_IND.text @@ -1,4 +1,3 @@ - 2 6 7 8 @@ -21,5 +20,6 @@ DEF o p q -The end. rstu vwx +yz rstu vwx +The end. diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 0b011e34..f243433a 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -2048,10 +2048,13 @@ export class InputHandler extends Disposable implements IInputHandler { */ public index(): void { this._restrictCursor(); + const buffer = this._bufferService.buffer; this._bufferService.buffer.y++; - if (this._bufferService.buffer.y > this._bufferService.buffer.scrollBottom) { - this._bufferService.buffer.y--; + if (buffer.y === buffer.scrollBottom + 1) { + buffer.y--; this._terminal.scroll(); + } else if (buffer.y >= this._bufferService.rows) { + buffer.y = this._bufferService.rows - 1; } this._restrictCursor(); } diff --git a/src/Terminal2.test.ts b/src/Terminal2.test.ts index 594558fb..0638e316 100644 --- a/src/Terminal2.test.ts +++ b/src/Terminal2.test.ts @@ -17,8 +17,6 @@ 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 - 't0071-DECSTBM_IND.in', 't0072-DECSTBM_NEL.in', 't0075-DECSTBM_CUU_CUD.in', 't0076-DECSTBM_IL_DL.in', // not working due to lineFeed