title |
---|
ansi_cursor |
[TOC]
Module for cursor control using ansi terminal escape sequences
The ESC character
ansi escape code to move the cursor to it's home coordinates (1,1)
ansi escape code to clear the screen till the start of the terminal
ansi escape code to clear the screen till the end of the terminal
ansi escape code to clear the terminal screen completely
ansi escape code to clear till the current line end
ansi escape code to clear till the current line start
ansi escape code to clear the entire line
Experimental
moves the cursor to the specified line
and column
code =
[[stdlib_ansi_cursor(module):move_to(function)]] (line, col)
Pure function.
line
: line (row) number to move it to
col
: col (column) number to move it to
a default character string
program test
use stdlib_ansi_cursor, only: move_to
implicit none
character(len=1) :: input
print *, move_to(1, 1) ! Same as printing the constant `home`
read (*,*), input ! Waiting for input to actually see the effect of the `move_to` function
end program test
A more detailed example of drawing a blue box in a terminal
{!example/terminal/example_ansi_cursor.f90!}
Experimental
moves the cursor to the specified column
code =
[[stdlib_ansi_cursor(module):move_to_column(function)]] (col)
Pure function.
col
: col (column) number to move it to
a default character string
Experimental
moves the cursor up by line
lines
code =
[[stdlib_ansi_cursor(module):move_up(function)]] (line)
Pure function.
line
: number of lines to move it above by
a default character string
Experimental
moves the cursor down by line
lines
code =
[[stdlib_ansi_cursor(module):move_down(function)]] (line)
Pure function.
line
: number of lines to move it below by
a default character string
Experimental
moves the cursor to the left by col
columns
code =
[[stdlib_ansi_cursor(module):move_left(function)]] (col)
Pure function.
col
: number of columns to move the cursor to the left by
a default character string
Experimental
moves the cursor to the right by col
columns
code =
[[stdlib_ansi_cursor(module):move_right(function)]] (col)
Pure function.
col
: number of columns to move the cursor to the right by
a default character string