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:
12
src/term.rs
12
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<()> {
|
||||
|
||||
Reference in New Issue
Block a user