Skip to content

@jsvision/core / cursorTo

Function: cursorTo() ​

cursorTo(row, col): string

Defined in: render/ansi.ts:30

Absolute cursor move to a 1-based (row, col) (CSI row;col H).

Parameters ​

row ​

number

1-based row (top is 1).

col ​

number

1-based column (left is 1).

Returns ​

string

The ANSI escape string to write to the terminal.

Example ​

ts
import { cursorTo } from '@jsvision/core';
process.stdout.write(cursorTo(1, 1) + 'top-left corner');