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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE 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 BE0B0230B5 for ; Wed, 28 Feb 2024 00:51:35 +0100 (CET) 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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=syE9CWmF2BIwAN6BdJ10UQJ1UEjxuqChAnxwrHznUAI=; b=P9DI+giXyC0qG2rv3ieTqkeQXd xC+K5ZObQQn3gKK/SwS+gP2qNE8p+eWqLJZXxMAZnawgjHMEVsEjYaXuoL0IJAU8CeivSB3De+9QI l6aCB9u5WVynZzh9osAuDxLmenZO7hp1LwzLFpyFgHxv6+O6RWfQWvP4nu85scNgIIy1GChXY42tv CW6eamNEU6XPOx9TPmr9QkD/Ubp95FCP02bLG/j9oGAc0sfe/xVQpsmVk9Tv/WIshpZrS1/NEi2hC fpke/6myKry0Z8oZarn8Wo8Prd4DNBAe2bbhCYNonz36KLTmOb9sIky4QcaCY8WQtBS3sAi+pAx30 Me+GfEvQ==; Received: by zero.zsh.org with local id 1rf7ES-000F2C-CI; Tue, 27 Feb 2024 23:51:32 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rf7EB-000EkN-8z; Tue, 27 Feb 2024 23:51:15 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1rf7EA-000000006ym-2XaM; Wed, 28 Feb 2024 00:51:14 +0100 cc: Zsh hackers list In-reply-to: From: Oliver Kiddle References: <73696-1708812060.096751@IRYQ.G6d0.hkDI> <14804-1709061923.292710@qlv_.smDE.ovA0> To: Bart Schaefer Subject: Re: PATCH: real-time signals support MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26830.1709077874.1@hydra> Date: Wed, 28 Feb 2024 00:51:14 +0100 Message-ID: <26831-1709077874.602561@9bQW.VzDm.Uqrt> X-Seq: 52626 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Bart Schaefer wrote: > I was thinking in terms of populating a hash-format of $signals given > that the array-format default is probably not going away. With the > paren after the numbers I ended up with: > > typeset -A sigs=( ${=${ printf "%d %s\n" ${=${ printf "(%s %s\n" > ${=${ kill -L }} }} }} ) I'll grant you that isn't trivial even if there may be shorter approaches. > The main reason is for terminals narrower than 80-ish columns; wider ones, meh. How about limiting it to a maximum of six columns like so? const int cols = zterm_columns >= 30 ? (zterm_columns < 90 ? zterm_columns / 15 : 6) : 1; Without the isatty(1) test it can still be piped in column form or you can use COLUMNS=1 to force single-column output. Or the `isatty(1) &&` can be added back in? > > A greater range of values appear to be open to shell functions but > > otherwise, that sounds about right. There's also negative values. > > There would never be a useful negative exit status, would there? Except for functions (and maybe builtins). Don't think I've ever used that. >From an external programme, it seems any value is received modulo 256. > Negative signals translate into the absolute value sent to the process > group leader, right? Isn't that negative pids? Or do either have that effect? Oliver