Skip to content

Commit 0f1f19b

Browse files
committed
fix(clear-screen): fix the clear screen
- on linux the screen was not properly cleared and the cursor mispositioned - dividing the 2 escape sequences helped
1 parent 5fa1d40 commit 0f1f19b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ fn main() -> Result<()> {
149149
/// TODO: that works strange on ubuntu
150150
/// escape sequences that clears the screen
151151
fn clear_screen() {
152-
println!("{esc}[2J{esc}[1;1H", esc = 27 as char);
153-
println!();
152+
print!("{esc}[2J", esc = 27 as char);
153+
print!("{esc}[H", esc = 27 as char);
154154
}
155155

156156
///

0 commit comments

Comments
 (0)