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

Method cursorDown

src/common/InputHandler.ts:920–929  ·  view source on GitHub ↗

* CSI Ps B * Cursor Down Ps Times (default = 1) (CUD). * * @vt: #Y CSI CUD "Cursor Down" "CSI Ps B" "Move cursor `Ps` times down (default=1)." * If the cursor would pass the bottom scroll margin, it will stop there.

(params: IParams)

Source from the content-addressed store, hash-verified

918 * If the cursor would pass the bottom scroll margin, it will stop there.
919 */
920 public cursorDown(params: IParams): boolean {
921 // stop at scrollBottom
922 const diffToBottom = this._activeBuffer.scrollBottom - this._activeBuffer.y;
923 if (diffToBottom >= 0) {
924 this._moveCursor(0, Math.min(diffToBottom, params.params[0] || 1));
925 } else {
926 this._moveCursor(0, params.params[0] || 1);
927 }
928 return true;
929 }
930
931 /**
932 * CSI Ps C

Callers 2

constructorMethod · 0.95
cursorNextLineMethod · 0.95

Calls 1

_moveCursorMethod · 0.95

Tested by

no test coverage detected