Raxol.Terminal.ANSI.Sequences.Cursor (Raxol v0.3.0)

View Source

ANSI Cursor Sequence Handler.

Handles parsing and application of ANSI cursor control sequences, including movement, position saving/restoring, and visibility.

Summary

Functions

Move cursor to absolute position.

Move cursor backward by specified number of columns.

Move cursor down by specified number of rows.

Move cursor forward by specified number of columns.

Move cursor up by specified number of rows.

Restore previously saved cursor position.

Save current cursor position.

Functions

move_cursor(emulator, row, col)

Move cursor to absolute position.

Parameters

  • emulator - The terminal emulator state
  • row - Row to move to (1-indexed)
  • col - Column to move to (1-indexed)

Returns

Updated emulator state

move_cursor_backward(emulator, n)

Move cursor backward by specified number of columns.

Parameters

  • emulator - The terminal emulator state
  • n - Number of columns to move backward

Returns

Updated emulator state

move_cursor_down(emulator, n)

Move cursor down by specified number of rows.

Parameters

  • emulator - The terminal emulator state
  • n - Number of rows to move down

Returns

Updated emulator state

move_cursor_forward(emulator, n)

Move cursor forward by specified number of columns.

Parameters

  • emulator - The terminal emulator state
  • n - Number of columns to move forward

Returns

Updated emulator state

move_cursor_up(emulator, n)

Move cursor up by specified number of rows.

Parameters

  • emulator - The terminal emulator state
  • n - Number of rows to move up

Returns

Updated emulator state

restore_cursor_position(emulator)

Restore previously saved cursor position.

Parameters

  • emulator - The terminal emulator state

Returns

Updated emulator state with restored cursor position

save_cursor_position(emulator)

Save current cursor position.

Parameters

  • emulator - The terminal emulator state

Returns

Updated emulator state with saved cursor position

set_cursor_visibility(emulator, visible)

Set cursor visibility.

Parameters

  • emulator - The terminal emulator state
  • visible - Boolean indicating visibility

Returns

Updated emulator state