wijjit.terminal.ansi.ANSIScreen

class wijjit.terminal.ansi.ANSIScreen[source]

ANSI screen control codes.

__init__()

Methods

__init__()

alternate_buffer_off()

Switch back to main screen buffer.

alternate_buffer_on()

Switch to alternate screen buffer.

clear()

Clear entire screen.

clear_line()

Clear current line.

clear_to_end()

Clear from cursor to end of screen.

clear_to_start()

Clear from cursor to start of screen.

set_window_title(title)

Set the terminal window (and icon) title via OSC 0.

static clear()[source]

Clear entire screen.

Returns:

ANSI escape sequence

Return type:

str

static clear_line()[source]

Clear current line.

Returns:

ANSI escape sequence

Return type:

str

static clear_to_end()[source]

Clear from cursor to end of screen.

Returns:

ANSI escape sequence

Return type:

str

static clear_to_start()[source]

Clear from cursor to start of screen.

Returns:

ANSI escape sequence

Return type:

str

static alternate_buffer_on()[source]

Switch to alternate screen buffer.

Returns:

ANSI escape sequence

Return type:

str

static alternate_buffer_off()[source]

Switch back to main screen buffer.

Returns:

ANSI escape sequence

Return type:

str

static set_window_title(title)[source]

Set the terminal window (and icon) title via OSC 0.

OSC 0 sets both the icon name and the window title. The sequence is widely supported across xterm, gnome-terminal, kitty, iTerm2, Windows Terminal, and modern conhost. Embedded control characters and the BEL terminator are stripped from title to prevent the sequence from being broken or escaped.

Parameters:

title (str) – The title text to display in the terminal title bar.

Returns:

ANSI OSC escape sequence terminated by BEL (\x07).

Return type:

str