Added -j flag to 'complete' for completing job names/pids

This commit is contained in:
2026-02-27 11:03:56 -05:00
parent a581f5161f
commit 3d47e4edd9
44 changed files with 3259 additions and 2853 deletions

View File

@@ -83,10 +83,10 @@ pub fn check_signals() -> ShResult<()> {
run_trap(Signal::SIGCHLD)?;
wait_child()?;
}
if got_signal(Signal::SIGWINCH) {
GOT_SIGWINCH.store(true, Ordering::SeqCst);
run_trap(Signal::SIGWINCH)?;
}
if got_signal(Signal::SIGWINCH) {
GOT_SIGWINCH.store(true, Ordering::SeqCst);
run_trap(Signal::SIGWINCH)?;
}
for sig in MISC_SIGNALS {
if got_signal(sig) {
@@ -157,7 +157,7 @@ pub fn hang_up(_: libc::c_int) {
SHOULD_QUIT.store(true, Ordering::SeqCst);
QUIT_CODE.store(1, Ordering::SeqCst);
write_jobs(|j| {
j.hang_up();
j.hang_up();
});
}
@@ -286,7 +286,7 @@ pub fn child_exited(pid: Pid, status: WtStat) -> ShResult<()> {
if is_fg {
take_term()?;
} else {
JOB_DONE.store(true, Ordering::SeqCst);
JOB_DONE.store(true, Ordering::SeqCst);
let job_order = read_jobs(|j| j.order().to_vec());
let result = read_jobs(|j| j.query(JobID::Pgid(pgid)).cloned());
if let Some(job) = result {