mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-27 15:40:03 +08:00
add clear_lastline
This commit is contained in:
@@ -167,6 +167,10 @@ pub fn flush_stdout() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear_lastline() {
|
||||||
|
print_lastline("");
|
||||||
|
}
|
||||||
|
|
||||||
pub fn print_lastline(line: &str) {
|
pub fn print_lastline(line: &str) {
|
||||||
print!("\x1b[1000D{}\x1b[K", line);
|
print!("\x1b[1000D{}\x1b[K", line);
|
||||||
flush_stdout();
|
flush_stdout();
|
||||||
|
|||||||
Reference in New Issue
Block a user