clearz 0.2.1

clear + scrollback reset = totally fresh your terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use clap::Parser;
use std::io::{self, Write};

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {}

fn main() {
    let _args = Args::parse();

    // \x1b[3J → clears the scrollback buffer
    // \x1b[H → moves cursor to home
    print!("\x1b[3J\x1b[H");
    // Make sure it's flushed immediately
    io::stdout().flush().unwrap();
}