Raxol.Terminal.ANSI.Emitter (Raxol v0.5.0)

View Source

ANSI escape sequence generation module.

Provides functions for generating ANSI escape sequences for terminal control:

  • Cursor movements
  • Colors and text attributes
  • Screen manipulation
  • Various terminal modes

Features

  • Cursor control (movement, visibility)
  • Screen manipulation (clearing, scrolling)
  • Text attributes (bold, underline, etc.)
  • Color control (foreground, background)
  • Terminal mode control

Summary

Functions

alternate_buffer_off()

alternate_buffer_on()

auto_wrap_off()

auto_wrap_on()

background(color_code)

background_256(color_code)

background_rgb(r, g, b)

blink()

bold()

bracketed_paste_off()

bracketed_paste_on()

clear_line()

clear_line_from_cursor()

clear_line_to_cursor()

clear_screen()

Generates ANSI sequences for screen manipulation.

Parameters

  • n - Number of lines to scroll (default: 1)

Returns

The ANSI escape sequence for the requested screen operation.

clear_screen_from_cursor()

clear_screen_to_cursor()

conceal()

cursor_backward(n \\ 1)

cursor_down(n \\ 1)

cursor_forward(n \\ 1)

cursor_hide()

cursor_position(row \\ 1, col \\ 1)

cursor_restore_position()

cursor_save_position()

cursor_show()

cursor_up(n \\ 1)

Generates ANSI sequences for cursor movement.

Parameters

  • n - Number of positions to move (default: 1)

Returns

The ANSI escape sequence for the requested cursor movement.

faint()

foreground(color_code)

Generates ANSI sequences for colors.

Parameters

  • color_code - The color code (0-15 for basic colors)

Returns

The ANSI escape sequence for the requested color.

foreground_256(color_code)

foreground_rgb(r, g, b)

inverse()

italic()

no_blink()

no_conceal()

no_inverse()

no_italic()

no_strikethrough()

no_underline()

normal_intensity()

rapid_blink()

reset_attributes()

Generates ANSI sequences for text attributes.

Returns

The ANSI escape sequence for the requested text attribute.

reset_mode(mode)

scroll_down_ansi(n \\ 1)

scroll_up_ansi(n \\ 1)

set_mode(mode)

Generates ANSI sequences for terminal modes.

strikethrough()

underline()