Raxol.Terminal.Cursor.Style (Raxol v0.2.0)
View SourceHandles cursor style and visibility control for the terminal emulator.
This module provides functions for changing cursor appearance, controlling visibility, and managing cursor blinking.
Summary
Functions
Makes the cursor blink.
Hides the cursor.
Sets the cursor style to bar.
Sets the cursor blink rate in milliseconds.
Sets the cursor style to block.
Sets a custom cursor shape.
Sets the cursor style to underline.
Makes the cursor visible.
Toggles the cursor blinking state.
Toggles the cursor visibility.
Updates the cursor blink state and returns the updated cursor and visibility.
Functions
Makes the cursor blink.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.blink(cursor)
iex> cursor.state
:blinking
Hides the cursor.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.hide(cursor)
iex> cursor.state
:hidden
Sets the cursor style to bar.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.set_bar(cursor)
iex> cursor.style
:bar
Sets the cursor blink rate in milliseconds.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.set_blink_rate(cursor, 1000)
iex> cursor.blink_rate
1000
Sets the cursor style to block.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.set_block(cursor)
iex> cursor.style
:block
Sets a custom cursor shape.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.set_custom(cursor, "█", {2, 1})
iex> cursor.style
:custom
iex> cursor.custom_shape
"█"
Sets the cursor style to underline.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.set_underline(cursor)
iex> cursor.style
:underline
Makes the cursor visible.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Manager.set_state(cursor, :hidden)
iex> cursor = Style.show(cursor)
iex> cursor.state
:visible
Toggles the cursor blinking state.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.toggle_blink(cursor)
iex> cursor.state
:blinking
iex> cursor = Style.toggle_blink(cursor)
iex> cursor.state
:visible
Toggles the cursor visibility.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.toggle_visibility(cursor)
iex> cursor.state
:hidden
iex> cursor = Style.toggle_visibility(cursor)
iex> cursor.state
:visible
Updates the cursor blink state and returns the updated cursor and visibility.
Examples
iex> alias Raxol.Terminal.Cursor.{Manager, Style}
iex> cursor = Manager.new()
iex> cursor = Style.blink(cursor)
iex> {cursor, visible} = Style.update_blink(cursor)
iex> is_boolean(visible)
true