MCPcopy
hub / github.com/xtermjs/xterm.js / scrollUp

Method scrollUp

src/common/InputHandler.ts:1429–1438  ·  view source on GitHub ↗

* CSI Ps S Scroll up Ps lines (default = 1) (SU). * * @vt: #Y CSI SU "Scroll Up" "CSI Ps S" "Scroll `Ps` lines up (default=1)." * * * FIXME: scrolled out lines at top = 1 should add to scrollback (xterm)

(params: IParams)

Source from the content-addressed store, hash-verified

1427 * FIXME: scrolled out lines at top = 1 should add to scrollback (xterm)
1428 */
1429 public scrollUp(params: IParams): boolean {
1430 let param = params.params[0] || 1;
1431
1432 while (param--) {
1433 this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1);
1434 this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
1435 }
1436 this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
1437 return true;
1438 }
1439
1440 /**
1441 * CSI Ps T Scroll down Ps lines (default = 1) (SD).

Callers 1

constructorMethod · 0.95

Calls 4

_eraseAttrDataMethod · 0.95
spliceMethod · 0.65
getBlankLineMethod · 0.65
markRangeDirtyMethod · 0.65

Tested by

no test coverage detected