mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
parent
645ab74c62
commit
4043ed34ae
@ -7,6 +7,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use atomic_take::AtomicTake;
|
use atomic_take::AtomicTake;
|
||||||
|
use clearscreen::ClearScreen;
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use tokio::{
|
use tokio::{
|
||||||
process::Command,
|
process::Command,
|
||||||
@ -154,9 +155,16 @@ pub enum Outcome {
|
|||||||
/// Send this signal to the command.
|
/// Send this signal to the command.
|
||||||
Signal(Signal),
|
Signal(Signal),
|
||||||
|
|
||||||
/// Clear the screen.
|
/// Clear the (terminal) screen.
|
||||||
Clear,
|
Clear,
|
||||||
|
|
||||||
|
/// Reset the (terminal) screen.
|
||||||
|
///
|
||||||
|
/// This invokes: [`WindowsCooked`][ClearScreen::WindowsCooked],
|
||||||
|
/// [`WindowsVt`][ClearScreen::WindowsVt], [`VtWellDone`][ClearScreen::VtWellDone],
|
||||||
|
/// and [the default][ClearScreen::default()], in this order.
|
||||||
|
Reset,
|
||||||
|
|
||||||
/// Exit watchexec.
|
/// Exit watchexec.
|
||||||
Exit,
|
Exit,
|
||||||
|
|
||||||
@ -391,6 +399,17 @@ async fn apply_outcome(
|
|||||||
clearscreen::clear()?;
|
clearscreen::clear()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(_, Outcome::Reset) => {
|
||||||
|
for cs in [
|
||||||
|
ClearScreen::WindowsCooked,
|
||||||
|
ClearScreen::WindowsVt,
|
||||||
|
ClearScreen::VtWellDone,
|
||||||
|
ClearScreen::default(),
|
||||||
|
] {
|
||||||
|
cs.clear()?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
(Some(_), Outcome::IfRunning(then, _)) => {
|
(Some(_), Outcome::IfRunning(then, _)) => {
|
||||||
apply_outcome(
|
apply_outcome(
|
||||||
*then,
|
*then,
|
||||||
|
Loading…
Reference in New Issue
Block a user