* CSI Ps A * Cursor Up Ps Times (default = 1) (CUU). * * @vt: #Y CSI CUU "Cursor Up" "CSI Ps A" "Move cursor `Ps` times up (default=1)." * If the cursor would pass the top scroll margin, it will stop there.
(params: IParams)
| 900 | * If the cursor would pass the top scroll margin, it will stop there. |
| 901 | */ |
| 902 | public cursorUp(params: IParams): boolean { |
| 903 | // stop at scrollTop |
| 904 | const diffToTop = this._activeBuffer.y - this._activeBuffer.scrollTop; |
| 905 | if (diffToTop >= 0) { |
| 906 | this._moveCursor(0, -Math.min(diffToTop, params.params[0] || 1)); |
| 907 | } else { |
| 908 | this._moveCursor(0, -(params.params[0] || 1)); |
| 909 | } |
| 910 | return true; |
| 911 | } |
| 912 | |
| 913 | /** |
| 914 | * CSI Ps B |
no test coverage detected