* CSI Ps M * Delete Ps Line(s) (default = 1) (DL). * * @vt: #Y CSI DL "Delete Line" "CSI Ps M" "Delete `Ps` lines at active row (default=1)." * For every deleted line at the scroll top one blank line at the scroll bottom gets appended. * The cursor is set to the first column. *
(params: IParams)
| 1342 | * DL has no effect if the cursor is outside the scroll margins. |
| 1343 | */ |
| 1344 | public deleteLines(params: IParams): boolean { |
| 1345 | this._restrictCursor(); |
| 1346 | let param = params.params[0] || 1; |
| 1347 | |
| 1348 | if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) { |
| 1349 | return true; |
| 1350 | } |
| 1351 | |
| 1352 | const row: number = this._activeBuffer.ybase + this._activeBuffer.y; |
| 1353 | |
| 1354 | let j: number; |
| 1355 | j = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom; |
| 1356 | j = this._bufferService.rows - 1 + this._activeBuffer.ybase - j; |
| 1357 | while (param--) { |
| 1358 | // test: echo -e '\e[44m\e[1M\e[0m' |
| 1359 | // blankLine(true) - xterm/linux behavior |
| 1360 | this._activeBuffer.lines.splice(row, 1); |
| 1361 | this._activeBuffer.lines.splice(j, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); |
| 1362 | } |
| 1363 | |
| 1364 | this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom); |
| 1365 | this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only? |
| 1366 | return true; |
| 1367 | } |
| 1368 | |
| 1369 | /** |
| 1370 | * CSI Ps @ |
no test coverage detected