term: move output to end; move from_dsl

This commit is contained in:
facile pop culture reference 2026-06-28 04:56:47 +03:00
parent 7613c65500
commit dd7091bda1
3 changed files with 46 additions and 43 deletions

View file

@ -97,13 +97,18 @@ use ::{
}
/// Spawn the TUI output thread which writes colored characters to the terminal.
///
/// ```
/// let state = Arc::new(RwLock::new(()));
/// Exit::run(|exit|tui_output(exit, state, sleep, stdout()))
/// ```
pub fn tui_output <
W: Write + Send + Sync + 'static, T: View<Tui> + Send + Sync + 'static
> (
output: W,
exited: &Arc<AtomicBool>,
state: &Arc<RwLock<T>>,
sleep: Duration
sleep: Duration,
output: W,
) -> Usually<Task> {
let state = state.clone();
stdout().execute(EnterAlternateScreen)?;