brush_core/shell/job_control.rs
1//! Job management for shell instances.
2
3use std::io::Write;
4
5use crate::{error, extensions};
6
7impl<SE: extensions::ShellExtensions> crate::Shell<SE> {
8 /// Checks for completed jobs in the shell, reporting any changes found.
9 pub fn check_for_completed_jobs(&mut self) -> Result<(), error::Error> {
10 let results = self.jobs.poll()?;
11
12 if self.options.enable_job_control {
13 for (job, _result) in results {
14 writeln!(self.stderr(), "{job}")?;
15 }
16 }
17
18 Ok(())
19 }
20}