pub struct Jobs { /* private fields */ }
Implementations§
Source§impl Jobs
impl Jobs
pub fn new(interactive: bool) -> Self
pub fn cap_term(&mut self)
Sourcepub fn new_job(&mut self) -> Job
pub fn new_job(&mut self) -> Job
Create a new job with the next job number. Note, this new job is NOT in the jobs list.
Sourcepub fn set_no_tty(&mut self)
pub fn set_no_tty(&mut self)
Set not on a tty.
Sourcepub fn set_interactive(&mut self, interactive: bool)
pub fn set_interactive(&mut self, interactive: bool)
Sets whether we are interactive or not.
Sourcepub fn get_job_mut(&mut self, job_id: u32) -> Option<&mut Job>
pub fn get_job_mut(&mut self, job_id: u32) -> Option<&mut Job>
Get the mutable job for job_id if it exists.
Sourcepub fn reap_procs(&mut self)
pub fn reap_procs(&mut self)
Check any pids in a job by calling wait and updating the books.
Sourcepub fn foreground_job(&mut self, job_num: u32)
pub fn foreground_job(&mut self, job_num: u32)
Move the job for job_num to te foreground.
Sourcepub fn background_job(&mut self, job_num: u32)
pub fn background_job(&mut self, job_num: u32)
Move the job for job_num to te background and running (start a stopped job in the background).
Sourcepub fn restore_terminal(&self)
pub fn restore_terminal(&self)
Restore terminal settings and put the shell back into the foreground.
Sourcepub fn clear_aliases(&mut self)
pub fn clear_aliases(&mut self)
Clears all the existing aliases.
Sourcepub fn remove_alias<S: AsRef<str>>(&mut self, name: S) -> Option<Run>
pub fn remove_alias<S: AsRef<str>>(&mut self, name: S) -> Option<Run>
Removes the alias name, return the value if removed..
Sourcepub fn add_alias_run(&mut self, name: String, value: Run)
pub fn add_alias_run(&mut self, name: String, value: Run)
Add an already parsed alias.
Sourcepub fn print_alias(&self, name: String)
pub fn print_alias(&self, name: String)
Print a the alias for name if set.
Sourcepub fn print_all_alias(&self)
pub fn print_all_alias(&self)
Print all the defined aliases.
Sourcepub fn set_local_var(&mut self, key: OsString, val: OsString)
pub fn set_local_var(&mut self, key: OsString, val: OsString)
Set a local var into key. Will overwrite an existing value.
Sourcepub fn get_local_var(&self, key: &OsStr) -> Option<&OsStr>
pub fn get_local_var(&self, key: &OsStr) -> Option<&OsStr>
Get the local var key or None if does not exist.
Sourcepub fn remove_local_var(&mut self, key: &OsStr) -> Option<OsString>
pub fn remove_local_var(&mut self, key: &OsStr) -> Option<OsString>
Remove the local var key. If key exists returns the removed value.
Sourcepub fn get_env_or_local_var(&self, key: &OsStr) -> Option<OsString>
pub fn get_env_or_local_var(&self, key: &OsStr) -> Option<OsString>
First tries to fin key in the environment then checks local variable and returns None if not found.