diff options
| author | mo8it <mo8it@proton.me> | 2024-08-24 00:14:12 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-24 00:14:12 +0200 |
| commit | 570bc9f32d7ef0bf741fab44d15f7cd54a1f3fc1 (patch) | |
| tree | 528eae66ebf8fc3250c827a0e5468e6e7569e141 /src/term.rs | |
| parent | 47976caa69e24ea9ee5d38918a0abea89ff10983 (diff) | |
Start list without Ratatui
Diffstat (limited to 'src/term.rs')
| -rw-r--r-- | src/term.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/term.rs b/src/term.rs index e1ac3da..07edf90 100644 --- a/src/term.rs +++ b/src/term.rs @@ -1,7 +1,17 @@ use std::io::{self, BufRead, StdoutLock, Write}; +use crossterm::{ + cursor::MoveTo, + terminal::{Clear, ClearType}, + QueueableCommand, +}; + pub fn clear_terminal(stdout: &mut StdoutLock) -> io::Result<()> { - stdout.write_all(b"\x1b[H\x1b[2J\x1b[3J") + stdout + .queue(MoveTo(0, 0))? + .queue(Clear(ClearType::All))? + .queue(Clear(ClearType::Purge)) + .map(|_| ()) } pub fn press_enter_prompt(stdout: &mut StdoutLock) -> io::Result<()> { |
