@ende/cli/unstable-ansi
ende add jsr:@ende/cliVersion 2026.10.15 on JSR.
Ansi is a module that offers export function s and variables that returns various Ansi Escape Sequences. This class is not an exhaustive list of what is possible with Ansi Escape Sequences, nor does it guarantee that every code will work in every terminal. The only way to guarantee that only one code will work in a particular terminal, is to check for yourself. Calling these export function s and variables does not automatically change the terminal settings. Only once they are passed to stdout or stderr will they take effect.
These codes were based off the xterm reference.
Exports
CursorStyle— CursorStyle is a export const enum used to set the value in setCursorStyle.deleteCharacters— Deletes `x` characters at cursor position and to the right. Shifting line content left.deleteLines— Deletes `x` lines at cursor position. Shifting below lines up.DISABLE_AUTO_WRAP— Causes cursor to remain on the same line when it hits the end of the current line. See also ENABLE_AUTO_WRAP.DISABLE_ORIGIN_MODE— Causes the top and bottom margins to enlarge to the user's display. See ENABLE_ORIGIN_MODE.DOUBLE_HEIGHT_BOTTOM— Causes content on the current line to enlarge, showing only the bottom half of the characters with each character taking up two columns. Can be used in combination with DOUBLE_HEIGHT_TOP on the previous line to make text appear twice as big.DOUBLE_HEIGHT_TOP— Causes content on the current line to enlarge, showing only the top half of characters with each character taking up two columns. Can be used in combination with DOUBLE_HEIGHT_BOTTOM on the next line to make text appear twice as big.DOUBLE_WIDTH— Causes content on the current line to stretch out, with each character taking up two columns. Can be reverted with SINGLE_WIDTH.ENABLE_AUTO_WRAP— Causes cursor to automatically move to the next line when it hits the end of the current line to continue writing. See also DISABLE_AUTO_WRAP.ENABLE_ORIGIN_MODE— Causes top and bottom margins to shrink to scrollable region (See setScrollableRegion) preventing the cursor from moving to the lines outside it.ERASE_DISPLAY— Erases all content.ERASE_DISPLAY_AFTER_CURSOR— Erases content of lines below cursor position and content to the right on the same line as cursor.ERASE_DISPLAY_BEFORE_CURSOR— Erases content of lines above cursor position and content to the left on the same line as cursor.ERASE_LINE— Erases entire line content.ERASE_LINE_AFTER_CURSOR— Erases line content to the right of cursor position.ERASE_LINE_BEFORE_CURSOR— Erases line content to the left of cursor position.eraseCharacters— Erases `x` characters at cursor position and to the right.HARD_RESET— This is a full reset of the terminal, reverting it back to its original default settings, clearing the screen, resetting modes, colors, character sets and more. Essentially making the terminal behave as if it were just started by the user. This command is very disruptive to the user. Also see SOFT_RESET.HIDE_CURSOR— Causes cursor position to be hidden from the user. See also SHOW_CURSOR.INSERT_MODE— Causes existing characters to the right of the cursor position to shift right as new characters are written. Opposite of REPLACE_MODE.insertLines— Inserts `x` lines at cursor position. Shifting current line and below down. Cursor position does not change. Characters that exit the display are discarded.insertSpace— Inserts `x` spaces at the cursor position. Shifting existing line content to the right. Cursor position does not change. Characters that exit the display are discarded.moveCursorDown— Moves cursor position down `x` lines or up to the bottom margin.moveCursorDownStart— Moves cursor position `x` lines down or up to the bottom margin, and to the beginning of that line.moveCursorLeft— Moves cursor position `x` columns left or up to the left margin.moveCursorLeftTab— Moves cursor position `x` tab stops left or up to the left margin.moveCursorRight— Moves cursor position `x` columns right or up to the right margin.moveCursorRightTab— Moves cursor position `x` tab stops right or up to the right margin.moveCursorUp— Moves cursor position up `x` lines or up to the top margin.moveCursorUpStart— Moves cursor position `x` lines up or up to the top of the margin, and to the beginning of that line.repeatLastCharacter— Repeats last graphic character printed `x` times at cursor position.REPLACE_MODE— Causes existing characters to be overwritten at the cursor position by new characters. See also INSERT_MODE.RESTORE_CURSOR— Restores: - cursor position - graphic rendition - character set shift state - state of wrap flag ENABLE_AUTO_WRAP - state of origin mode ENABLE_ORIGIN_MODE - selective eraserSAVE_CURSOR— Saves: - cursor position - graphic rendition - character set shift state - state of wrap flag ENABLE_AUTO_WRAP - state of origin mode ENABLE_ORIGIN_MODE - selective erasersetCursorColumn— Sets cursor position to column `x` or up to the sides of the margins. Columns begin at `1` not `0`.setCursorLine— Sets cursor position to line `x` or down to the bottom of the margin. Lines begin at `1` not `0`.setCursorPosition— Sets cursor position to `x` line and `y` column or up to the margin. Lines and columns begin at `1` not `0`.setCursorStyle— Sets the cursor animation style.setScrollableRegion— Sets the scrollable region of the display. Allowing either or both the top and bottom lines to not have their content moved when the scrolling region is updated. `x` is the top line of the scrollable region. `y` is the bottom line of the scrollable region.shiftDownAndInsert— Shifts content within the scrollable region down `x` lines, inserting blank lines at the top of the scrollable region.shiftUpAndInsert— Shifts content within the scrollable region up `x` lines, inserting blank lines at the bottom of the scrollable region.SHOW_CURSOR— Causes cursor position to be visible to the user. See also HIDE_CURSOR.SINGLE_WIDTH— Causes content on the current line to shrink down to a single column, essentially reverting the effects of DOUBLE_HEIGHT_TOP, DOUBLE_HEIGHT_BOTTOM, or DOUBLE_WIDTH.SOFT_RESET— This command resets many settings to their initial state without fully reinitializing the terminal like HARD_RESET. It preserves things like cursor position and display content, but clears modes, character sets, etc. Should probably be called when exiting the program.