Propagate SIGINT from foreground jobs to interrupt shell loops, add SIGUSR1 for async prompt refresh, and support SHED_HPAGER override
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use ariadne::Fmt;
|
||||
use nix::unistd::getpid;
|
||||
use scopeguard::defer;
|
||||
use yansi::Color;
|
||||
|
||||
@@ -872,7 +873,12 @@ pub fn wait_fg(job: Job, interactive: bool) -> ShResult<()> {
|
||||
write_jobs(|j| j.fg_to_bg(*status))?;
|
||||
}
|
||||
WtStat::Signaled(_, sig, _) => {
|
||||
if *sig == Signal::SIGTSTP {
|
||||
if *sig == Signal::SIGINT {
|
||||
// interrupt propagates to the shell
|
||||
// necessary for interrupting stuff like
|
||||
// while/for loops
|
||||
kill(getpid(), Signal::SIGINT)?;
|
||||
} else if *sig == Signal::SIGTSTP {
|
||||
was_stopped = true;
|
||||
write_jobs(|j| j.fg_to_bg(*status))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user