1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-12-03 22:59:07 +02:00

Start list without Ratatui

This commit is contained in:
mo8it
2024-08-24 00:14:12 +02:00
parent 47976caa69
commit 570bc9f32d
14 changed files with 303 additions and 500 deletions

View File

@@ -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<()> {