* Moves the cursor to the x and y coordinate on the given stream. * @param {integer} x * @param {integer} [y] * @returns {Readline} this
(x, y = undefined)
| 42 | * @returns {Readline} this |
| 43 | */ |
| 44 | cursorTo(x, y = undefined) { |
| 45 | validateInteger(x, 'x'); |
| 46 | if (y != null) validateInteger(y, 'y'); |
| 47 | |
| 48 | const data = y == null ? CSI`${x + 1}G` : CSI`${y + 1};${x + 1}H`; |
| 49 | if (this.#autoCommit) process.nextTick(() => this.#stream.write(data)); |
| 50 | else ArrayPrototypePush(this.#todo, data); |
| 51 | |
| 52 | return this; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Moves the cursor relative to its current location. |
no test coverage detected