clgl/
tools.rs

1use std::io::{self, Write};
2
3/// Clears the terminal.
4pub fn clear_terminal() {
5    io::stdout().write_all(b"\x1b[2J").unwrap();
6}
7
8/// Sets the cursors position to the top-left corner in the terminal.
9pub fn reset_cursor_position() {
10    io::stdout().write_all(b"\x1b[H").unwrap();
11}