ansi_control 0.1.0

Library for controlling a cursor and a screen, on ANSI terminals.

Crate ansi_control [] [src]

This is a library for controlling a cursor and a screen, on ANSI terminals.

Example

use ansi_control::*;

println!("test 0");
print!("{}", set_column(1));
println!("test 1");
print!("{}", clear_display(Pos::Both));

Enums

Pos

A Pos is position of clearing (display|line) from cursor.

Functions

clear_display

Clears part of screen. If pos is Pos::Back, clear from cursor to the end of the screen. If pos is Pos::Front, clear from cursor to beginning of the screen. If pos is Pos::Both, clear entire screen.

clear_line

Clears part of line. If pos is Pos::Back, clear from cursor to the end of the line. If pos is Pos::Front, clear from cursor to beginning of the line. If pos is Pos::Both, clear entire line.

move_cursor

Moves the cursor i (row), j (column) cells. If the cursor is already at the edge of the screen, this has no effect.

move_line

Moves the cursor to beginning of the line n lines down. If n is a negative number, this function moves the cursor |n| lines up.

scroll

Scroll whole page up by n lines. If n is a negative number, this function scroll whole page down by |n| lines.

set_column

Sets the column of the cursor. (n: column)

set_position

Sets the position of the cursor. (i: row, j: column)