/** * Move cursor to absolute position (1-based coordinates) * Format: \x1b[row;colH */ export declare function moveCursorTo(x: number, y: number): string; /** * Move cursor up N lines * Format: \x1b[nA */ export declare function moveCursorUp(n: number): string; /** * Move cursor down N lines * Format: \x1b[nB */ export declare function moveCursorDown(n: number): string; /** * Move cursor right N columns * Format: \x1b[nC */ export declare function moveCursorRight(n: number): string; /** * Move cursor left N columns * Format: \x1b[nD */ export declare function moveCursorLeft(n: number): string; /** * Move cursor to start of line (move left a large number to ensure we're at column 1) * Format: \x1b[1000D * This is more reliable than \r in some terminals * From: https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html */ export declare const MOVE_TO_START_OF_LINE = "\u001B[1000D"; export declare const CLEAR_LINE = "\u001B[2K"; export declare const CLEAR_TO_END = "\u001B[0K"; export declare const CLEAR_TO_START = "\u001B[1K"; export declare const HIDE_CURSOR = "\u001B[?25l"; export declare const SHOW_CURSOR = "\u001B[?25h"; export declare const SAVE_CURSOR = "\u001B[s"; export declare const RESTORE_CURSOR = "\u001B[u"; export declare const RESET = "\u001B[0m"; /** * Delete N lines starting from the current line * Format: \x1b[nM (deletes n lines, shifting content up) */ export declare function deleteLines(n: number): string; /** * Erase Display (ED) - Clear from cursor to end of screen * Format: \x1b[J or \x1b[0J * This clears everything from the cursor position to the end of the screen */ export declare const ERASE_TO_END = "\u001B[J"; /** * Erase Display (ED) - Clear from cursor to beginning of screen * Format: \x1b[1J * This clears everything from the beginning of the screen to the cursor position */ export declare const ERASE_TO_START = "\u001B[1J"; /** * Erase Display (ED) - Clear entire screen * Format: \x1b[2J * This clears the entire screen and moves cursor to home position */ export declare const ERASE_SCREEN = "\u001B[2J"; /** * Disable terminal auto-wrap mode (DECAWM off) * * When auto-wrap is disabled: * - Text that exceeds terminal width is cut off (doesn't wrap to next line) * - Useful for right-pinned elements like OhMyZsh prompts * - Content stays at fixed column position, making updates easier * * Equivalent to: `tput rmam` (reset mode automatic margins) * Format: \x1b[?7l * * IMPORTANT: Always re-enable auto-wrap after writing non-wrapping content! * Use ENABLE_AUTO_WRAP to restore default behavior. */ export declare const DISABLE_AUTO_WRAP = "\u001B[?7l"; /** * Enable terminal auto-wrap mode (DECAWM on) * * Re-enables automatic wrapping (default terminal behavior). * Text that exceeds terminal width will wrap to the next line. * * Equivalent to: `tput smam` (set mode automatic margins) * Format: \x1b[?7h * * This is the default terminal state. Use this to restore after DISABLE_AUTO_WRAP. */ export declare const ENABLE_AUTO_WRAP = "\u001B[?7h"; /** * Switch to the terminal's alternate screen buffer. * Commonly used by fullscreen TUIs so the main screen is restored on exit. */ export declare const ENTER_ALTERNATE_SCREEN = "\u001B[?1049h"; /** * Return to the main screen buffer from the alternate buffer. */ export declare const EXIT_ALTERNATE_SCREEN = "\u001B[?1049l"; /** * Query cursor position (DSR - Device Status Report) * Format: \x1b[6n * * Sends a query to the terminal asking for the current cursor position. * Terminal responds with: \x1b[row;colR (e.g., \x1b[10;5R means row 10, column 5) * * This can be used to query the actual cursor position after resize/scroll, * instead of relying on SAVE/RESTORE which may become invalid. * * Note: Requires reading from stdin and parsing the response asynchronously. */ export declare const QUERY_CURSOR_POSITION = "\u001B[6n"; //# sourceMappingURL=ansi.d.ts.map