Module: RichEngine::Terminal::Cursor Private

Extended by:
Cursor
Included in:
Cursor
Defined in:
lib/rich_engine/terminal/cursor.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Internal plumbing for controlling the terminal cursor: visibility and positioning.

Instance Method Summary collapse

Instance Method Details

#displayvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Shows the cursor.



22
23
24
# File 'lib/rich_engine/terminal/cursor.rb', line 22

def display
  system("tput cnorm")
end

#goto(x, y) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Moves the cursor to the given screen position.

Parameters:

  • x (Integer)

    the column to move to

  • y (Integer)

    the row to move to



31
32
33
# File 'lib/rich_engine/terminal/cursor.rb', line 31

def goto(x, y)
  $stdout.goto(x, y)
end

#hidevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Hides the cursor.



15
16
17
# File 'lib/rich_engine/terminal/cursor.rb', line 15

def hide
  system("tput civis")
end