Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

How to propagate SIGTERM to the foreground job, if any?



How to propagate SIGTERM to the foreground job, if any?

I would have thought that the following would work:

setopt TRAPS_ASYNC
trap "trap - TERM; kill ${jobstates:+%%} $$" TERM

But it seems that $jobstates is not available in the trap.

Note: "kill %% $$" is no OK because I do not want an error message
if there are no jobs.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Messages sorted by: Reverse Date, Date, Thread, Author