Raxol.Terminal.Commands.Screen (Raxol v0.2.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 the screen down.
Scrolls the screen up.
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(), integer()) :: Raxol.Terminal.Emulator.t()
Scrolls the screen down.
Parameters
emulator
- The current emulator statecount
- The number of lines to scroll
Returns
- Updated emulator state
@spec scroll_up(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Scrolls the screen up.
Parameters
emulator
- The current emulator statecount
- The number of lines to scroll
Returns
- Updated emulator state