From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 7A0A321CD2 for ; Sun, 21 Apr 2024 19:45:45 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713721545; b=CdE5e2lNd2yB6uU33+rnRiU12gnAxyA7uW5d9m8PZ6u/RuLuk6c3W/4LxCJ8nAEb/ii7k4J7TU 3XkBfX7rsj+xhO7FJulrlNqvxAZpmRdvVpWIe/Pb9cJD9yW77IF3zqhfiHfR4g0qL0eG4JxBsc TjEBp0qhwwZBYRlC3Vdlsn9FvJ4DMzojQ+Bujj1hy3jEG3bHmQ7a/k+KuBRSGTIxdZnefRNdJu GjqQHftAE6799K+td7GPN5gbixiR7MePphEnvkepv1/HdqriGCpCYxr80y4EIWmKvyZzPugOJ2 BvzrZhRU1dJN34IApjl1QXzS1GkboIvK6lLk/u0M3pJD0A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1713721545; bh=YABJ0LFN5iktxlcMBLTUvFTK2ttKh9V+tAbN3ICes58=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=EoSvhdsoBYq6C0HfPTaRS8MT8EPk1M6AmXSPw0AeuzxDglGn9AcnXKhRHd2Zx2Sm89QG3pi4Fv MFyz3Z1QbizIkmK4610nnRHpHDy4XeSPH00m+5g/+nDImaz2TZ6ADkoafX0E2VH3Dqztx8P+q6 9EsxciS1oA5PIP81KbaJ+HGJckASQO+U9N3RETBkinc2WEsnBYckbFK6JzoZeM9OyG2i18uNlF RXLLcSspLIhmGrIsxXElRP1AR9CAVCGlsHjTyMvoPxaF9vTgz9u7hheonVvfuxW49d4vtAqNbx XZkZdy4GKOiLKjjITI4pWwyCt1Ty0sKENzAOM55HaitbEQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=J2ID+I2TP+sgncvkzskrBvYpTshGWyeLDk9du0IVyYU=; b=bXmtAugpOGTTiJ2TM2bGRtgqyz L6cagFFUByn+GKmEnnWfVJKe6CLctqEkn2asy+bvgNGLprsSzfCBrUe1K4PQ9ckY+1QcbcfIovyQK 8p72ULwxvhICdanmGWtMGxNh3zfiNHln/xTYOP7nIiNAvVd9bjF3dhs+OAsisUuO+BhsvR3naBswf cFb4XQDRZRnAdFmYwdlKX5RkXreUta9JfdlBhmIidtxbbAsfXy92oaQxD86Isdza17Rhv/2b5Z3Qg mAj4MhdJQQvyZmySEYUg6T+qJwuIX55a/WwUB/fhwClSGqH0twX+2d1Pg3g0qabCFe+ocFrX2rMX0 Hpv9v+eQ==; Received: by zero.zsh.org with local id 1rybG5-0000Vo-QB; Sun, 21 Apr 2024 17:45:45 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:56460) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rybEO-000PfR-Jr; Sun, 21 Apr 2024 17:44:01 +0000 Received: from smtp-qaa.vinc17.net (2a02-8428-1b1d-4d01-96a9-491d-7b48-ba31.rev.sfr.net [IPv6:2a02:8428:1b1d:4d01:96a9:491d:7b48:ba31]) by joooj.vinc17.net (Postfix) with ESMTPSA id 5E92E49F; Sun, 21 Apr 2024 19:44:00 +0200 (CEST) Received: by qaa.vinc17.org (Postfix, from userid 1000) id 56CDBCA011A; Sun, 21 Apr 2024 19:43:58 +0200 (CEST) Date: Sun, 21 Apr 2024 19:43:58 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: How to propagate SIGTERM to the foreground job, if any? Message-ID: <20240421174358.GC146837@qaa.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20240419171752.GA48158@cventin.lip.ens-lyon.fr> <20240419190027.GA109916@joooj.vinc17.net> <20240419213225.GA146837@qaa.vinc17.org> <20240421172909.GB146837@qaa.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240421172909.GB146837@qaa.vinc17.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.12+69 (354c5b11) vl-149028 (2023-12-10) X-Seq: 29853 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 2024-04-21 19:29:09 +0200, Vincent Lefevre wrote: > On 2024-04-20 21:09:46 -0700, Bart Schaefer wrote: > > Why not do it like this? > > > > setopt TRAPS_ASYNC > > echo $$ > > trap 'kill $xterm; exit' TERM > > xterm & xterm=$! > > wait $xterm > > echo end > > xterm was just a very simple example. In practice, several commands > are involved, and among them, there are zsh functions that may need > to affect the environment. Moreover, a Ctrl-C in the terminal doesn't seem to be handled correctly (here, ssh-add with several files in argument is executed via zsh functions, but it refuses to quit on Ctrl-C). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)