Raxol.Terminal.Commands.Screen (Raxol v0.5.0)

View Source

Handles screen manipulation commands in the terminal.

This module provides functions for clearing the screen or parts of it, inserting and deleting lines, and other screen manipulation operations.

Summary

Functions

Clears a line or part of a line based on the mode parameter.

Clears the screen or a part of it based on the mode parameter.

Deletes lines at the current cursor position.

Inserts blank lines at the current cursor position.

Scrolls down by moving lines from the screen buffer into the scrollback buffer.

Scrolls the screen up by the specified number of lines.

Scrolls the screen up by moving lines from the scrollback buffer to the screen buffer.

Functions

clear_line(emulator, mode)

Clears a line or part of a line based on the mode parameter.

Parameters

  • emulator - The current emulator state
  • mode - The clear mode:
    • 0 - Clear from cursor to end of line
    • 1 - Clear from beginning of line to cursor
    • 2 - Clear entire line

Returns

  • Updated emulator state

clear_screen(emulator, mode)

Clears the screen or a part of it based on the mode parameter.

Parameters

  • emulator - The current emulator state
  • mode - The clear mode:
    • 0 - Clear from cursor to end of screen
    • 1 - Clear from beginning of screen to cursor
    • 2 - Clear entire screen but don't move cursor
    • 3 - Clear entire screen including scrollback

Returns

  • Updated emulator state

delete_lines(emulator, count)

Deletes lines at the current cursor position.

Parameters

  • emulator - The current emulator state
  • count - The number of lines to delete

Returns

  • Updated emulator state

insert_lines(emulator, count)

Inserts blank lines at the current cursor position.

Parameters

  • emulator - The current emulator state
  • count - The number of lines to insert

Returns

  • Updated emulator state

scroll_down(emulator, count)

Scrolls down by moving lines from the screen buffer into the scrollback buffer.

scroll_up(emulator, lines)

Scrolls the screen up by the specified number of lines.

scroll_up_screen_command(emulator, count)

@spec scroll_up_screen_command(Raxol.Terminal.Emulator.t(), non_neg_integer()) ::
  Raxol.Terminal.Emulator.t()

Scrolls the screen up by moving lines from the scrollback buffer to the screen buffer.