1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/// clear() - Clear the entire screen
///
/// Clears the entire screen and moves the cursor to the top-left corner.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear;
/// use std::{time, thread};
///
/// let one_sec = time::Duration::from_millis(1000);
///
/// // Print some data
/// for _ in 0..10 {
/// println!("Hello, world!");
/// }
///
/// thread::sleep(one_sec);
///
/// println!("{}", clear());
/// ```
/// clear_from_cursor() - Clear screen from cursor to end
///
/// Clears from the cursor to the end of the screen.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_from_cursor;
///
/// println!("{}", clear_from_cursor());
/// ```
/// clear_to_cursor() - Clear screen from start to cursor
///
/// Clears from the beginning of the screen to the cursor.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_to_cursor;
///
/// println!("{}", clear_to_cursor());
/// ```
/// clear_all() - Clear entire screen and scrollback buffer
///
/// Clears the entire screen and the terminal scrollback buffer.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_all;
///
/// println!("{}", clear_all());
/// ```
/// clear_line() - Clear the entire current line
///
/// Clears the entire current line where the cursor is.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_line;
///
/// println!("{}", clear_line());
/// ```
/// clear_line_from_cursor() - Clear from cursor to end of line
///
/// Clears the current line from the cursor to the end.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_line_from_cursor;
///
/// println!("{}", clear_line_from_cursor());
/// ```
/// clear_line_to_cursor() - Clear from beginning of line to cursor
///
/// Clears the current line from the start to the cursor.
///
/// # Examples
///
/// ```
/// use ransi::screen::clear_line_to_cursor;
///
/// println!("{}", clear_line_to_cursor());
/// ```