我的控制台应用程序需要清除屏幕。如何真正清屏,就像Linux中的reset命令一样?
我尝试使用在 Google 上找到的方法,例如:
print!("{}[2J", 27 as char); // First attempt
print!("{}", termion::clear::All); // 'termion' crate, version 1.5.3
Run Code Online (Sandbox Code Playgroud)
它们都只是向下滚动,将之前的输出留在后面。我想过通过Rust执行reset命令,但肯定还有其他方法吧?