adds cli compatible prompts/logs adds logfile function for debug adds multiselect support new fieldRename adds listFieldNames
30 lines
592 B
TypeScript
30 lines
592 B
TypeScript
export class Cursor {
|
|
private static visible = true;
|
|
|
|
static show() {
|
|
this.visible = true;
|
|
Deno.stdout.writeSync(new TextEncoder().encode("\x1b[?25h"));
|
|
}
|
|
|
|
static hide() {
|
|
this.visible = false;
|
|
Deno.stdout.writeSync(new TextEncoder().encode("\x1b[?25l"));
|
|
}
|
|
|
|
static restoreVisibility() {
|
|
if (this.visible) {
|
|
this.show();
|
|
} else {
|
|
this.hide();
|
|
}
|
|
}
|
|
|
|
static savePosition() {
|
|
Deno.stdout.writeSync(new TextEncoder().encode("\x1b7"));
|
|
}
|
|
|
|
static restorePosition() {
|
|
Deno.stdout.writeSync(new TextEncoder().encode("\x1b8"));
|
|
}
|
|
}
|