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:
2026-03-16 19:00:33 -04:00
parent 958dad9942
commit db3f1b5108
7 changed files with 64 additions and 23 deletions

View File

@@ -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))?;
}