ERASE_DISPLAY_BEFORE_CURSOR

import { ERASE_DISPLAY_BEFORE_CURSOR } from "jsr:@ende/cli/unstable-ansi";

variable ยท experimental

const ERASE_DISPLAY_BEFORE_CURSOR: "\u001b[1J"

Erases content of lines above cursor position and content to the left on the same line as cursor.

Returns

The ANSI escape code for erasing the content before the cursor.

Example: Usage

import { delay } from "@ende/async/delay";
import * as Ansi from "@ende/cli/unstable-ansi";

console.log("Hello World!");
await delay(1000);
console.log(
  Ansi.moveCursorUp() +
    Ansi.setCursorColumn(7) +
    Ansi.ERASE_DISPLAY_BEFORE_CURSOR,
);

Source