Raxol.Terminal.Commands.Screen (Raxol v0.5.0)
View SourceHandles 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
@spec clear_line(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Clears a line or part of a line based on the mode parameter.
Parameters
emulator
- The current emulator statemode
- 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
@spec clear_screen(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Clears the screen or a part of it based on the mode parameter.
Parameters
emulator
- The current emulator statemode
- 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
@spec delete_lines(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Deletes lines at the current cursor position.
Parameters
emulator
- The current emulator statecount
- The number of lines to delete
Returns
- Updated emulator state
@spec insert_lines(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Inserts blank lines at the current cursor position.
Parameters
emulator
- The current emulator statecount
- The number of lines to insert
Returns
- Updated emulator state
@spec scroll_down(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Scrolls down by moving lines from the screen buffer into the scrollback buffer.
@spec scroll_up(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Scrolls the screen up by the specified number of lines.
@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.