Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to propagate SIGTERM to the foreground job, if any?
- X-seq: zsh-users 29834
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: How to propagate SIGTERM to the foreground job, if any?
- Date: Fri, 19 Apr 2024 19:17:52 +0200
- Archived-at: <https://zsh.org/users/29834>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
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