mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Send signals in the correct order in hup_jobs()
If the backgrounded/stopped job was using the tty, sending it SIGCONT first might cause it to immediately wake and try to use the tty (which fish still has control over), causing it to immediately stop again after receiving a SIGTTOU. We are supposed to send SIGHUP first so that when the process resumes it sees the queued SIGHUP and executes its registered handler!
This commit is contained in:
parent
e1ee193822
commit
6c944debec
@ -1299,10 +1299,10 @@ pub fn hup_jobs(jobs: &JobList) {
|
||||
for j in jobs {
|
||||
let Some(pgid) = j.get_pgid() else { continue };
|
||||
if pgid != fish_pgrp && !j.is_completed() {
|
||||
j.signal(SIGHUP);
|
||||
if j.is_stopped() {
|
||||
j.signal(SIGCONT);
|
||||
}
|
||||
j.signal(SIGHUP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user