Raxol.Terminal.Commands.Screen (Raxol v0.4.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 the screen down.

Scrolls the screen up.

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 the screen down.

If there are lines in the emulator's scrollback_buffer, restores up to count lines from scrollback into the visible buffer. Otherwise, inserts blank lines as before.

Parameters

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

Returns

  • Updated emulator state

scroll_up(emulator, count)

Scrolls the screen up.

Parameters

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

Returns

  • Updated emulator state