mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 14:51:25 +00:00
[ty] clear the terminal screen in watch mode (#19712)
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
f473f6b6e5
commit
de77b29798
4 changed files with 11 additions and 0 deletions
|
@ -261,6 +261,9 @@ impl MainLoop {
|
|||
let mut revision = 0u64;
|
||||
|
||||
while let Ok(message) = self.receiver.recv() {
|
||||
if self.watcher.is_some() {
|
||||
Printer::clear_screen()?;
|
||||
}
|
||||
match message {
|
||||
MainLoopMessage::CheckWorkspace => {
|
||||
let db = db.clone();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use std::io::StdoutLock;
|
||||
|
||||
use anyhow::Result;
|
||||
use indicatif::ProgressDrawTarget;
|
||||
|
||||
use crate::logging::VerbosityLevel;
|
||||
|
@ -101,6 +102,11 @@ impl Printer {
|
|||
pub(crate) fn stream_for_details(self) -> Stdout {
|
||||
self.stdout_general()
|
||||
}
|
||||
|
||||
pub(crate) fn clear_screen() -> Result<()> {
|
||||
clearscreen::clear()?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue