Raxol.Terminal.ScreenUpdater (Raxol v0.5.0)

View Source

Manages terminal screen state and updates.

This module is responsible for:

  • Managing screen buffer state
  • Handling screen updates
  • Coordinating screen state transitions
  • Managing screen dimensions

Summary

Functions

Updates the screen with multiple updates.

Clears the screen.

Gets the current screen dimensions.

Updates the screen with a single update.

Functions

batch_update_screen(emulator, updates)

@spec batch_update_screen(Raxol.Terminal.Emulator.t(), [map()]) ::
  {Raxol.Terminal.Emulator.t(), any()}

Updates the screen with multiple updates.

Parameters

  • emulator - The current terminal emulator state
  • updates - The list of screen updates to apply

Returns

  • {updated_emulator, output} - The updated emulator state and any output

clear_screen(emulator)

Clears the screen.

Parameters

  • emulator - The current terminal emulator state

Returns

  • updated_emulator - The updated emulator state

get_dimensions(emulator)

@spec get_dimensions(Raxol.Terminal.Emulator.t()) :: {integer(), integer()}

Gets the current screen dimensions.

Parameters

  • emulator - The current terminal emulator state

Returns

  • {width, height} - The current screen dimensions

handle_resize(emulator, width, height)

Handles screen resize.

Parameters

  • emulator - The current terminal emulator state
  • width - The new width
  • height - The new height

Returns

  • updated_emulator - The updated emulator state

update_screen(emulator, update)

@spec update_screen(Raxol.Terminal.Emulator.t(), map()) ::
  {Raxol.Terminal.Emulator.t(), any()}

Updates the screen with a single update.

Parameters

  • emulator - The current terminal emulator state
  • update - The screen update to apply

Returns

  • {updated_emulator, output} - The updated emulator state and any output