diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 14d18dfdf..658b94458 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -615,11 +615,23 @@ export class InputHandler extends Disposable implements IInputHandler { } else if (this._terminal.buffer.y >= this._terminal.rows) { this._terminal.buffer.y = this._terminal.rows - 1; } + if (this._terminal.originMode) { + if (this._terminal.buffer.y < this._terminal.buffer.scrollTop) { + this._terminal.buffer.y = this._terminal.buffer.scrollTop; + } else if (this._terminal.buffer.y > this._terminal.buffer.scrollBottom) { + this._terminal.buffer.y = this._terminal.buffer.scrollBottom; + } + } } private _setCursor(x: number, y: number): void { - this._terminal.buffer.x = x; - this._terminal.buffer.y = y; + if (this._terminal.originMode) { + this._terminal.buffer.x = x; + this._terminal.buffer.y = this._terminal.buffer.scrollTop + y; + } else { + this._terminal.buffer.x = x; + this._terminal.buffer.y = y; + } this._restrictCursor(); } diff --git a/src/Terminal2.test.ts b/src/Terminal2.test.ts index 0555368bf..e1af13fc7 100644 --- a/src/Terminal2.test.ts +++ b/src/Terminal2.test.ts @@ -136,9 +136,10 @@ if (os.platform() !== 'win32') { // 't0100-IRM.in', 't0101-NLM.in', 't0103-reverse_wrap.in', - 't0504-vim.in', + 't0504-vim.in' + // vttest related files - 't0300-vttest1.in' + // 't0300-vttest1.in' ]; if (os.platform() === 'darwin') { // These are failing on macOS only