Raxol.Terminal.State (Raxol v0.5.0)

View Source

Provides state management for the terminal emulator. This module handles operations like creating new states, saving and restoring states, and managing state transitions.

Summary

Functions

Gets the current cursor position.

Gets the current screen buffer.

Creates a new terminal state with the specified dimensions and limits.

Restores the most recently saved state.

Saves the current state.

Sets the cursor position.

Sets the screen buffer.

Functions

get_cursor_position(state)

@spec get_cursor_position(map()) :: {non_neg_integer(), non_neg_integer()}

Gets the current cursor position.

get_screen_buffer(state)

@spec get_screen_buffer(map()) :: Raxol.Terminal.ScreenBuffer.t()

Gets the current screen buffer.

new(width, height, scrollback_limit, memory_limit)

Creates a new terminal state with the specified dimensions and limits.

restore_state(state)

@spec restore_state(map()) :: map()

Restores the most recently saved state.

save_state(state)

@spec save_state(map()) :: map()

Saves the current state.

set_cursor_position(state, x, y)

@spec set_cursor_position(map(), non_neg_integer(), non_neg_integer()) :: map()

Sets the cursor position.

set_screen_buffer(state, buffer)

@spec set_screen_buffer(map(), Raxol.Terminal.ScreenBuffer.t()) :: map()

Sets the screen buffer.