zsh-users
 help / color / mirror / code / Atom feed
* How to propagate SIGTERM to the foreground job, if any?
@ 2024-04-19 17:17 Vincent Lefevre
  2024-04-19 18:30 ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Vincent Lefevre @ 2024-04-19 17:17 UTC (permalink / raw)
  To: zsh-users

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@vinc17.net> - 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)


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-04-23 17:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 17:17 How to propagate SIGTERM to the foreground job, if any? Vincent Lefevre
2024-04-19 18:30 ` Bart Schaefer
2024-04-19 19:00   ` Vincent Lefevre
2024-04-19 20:06     ` Bart Schaefer
2024-04-19 21:32       ` Vincent Lefevre
2024-04-21  4:09         ` Bart Schaefer
2024-04-21 17:29           ` Vincent Lefevre
2024-04-21 17:43             ` Vincent Lefevre
2024-04-21 21:25               ` Bart Schaefer
2024-04-21 23:59                 ` Vincent Lefevre
2024-04-22  0:41                   ` Bart Schaefer
2024-04-23 15:17                     ` Vincent Lefevre
2024-04-23 17:32                       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).