zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: real-time signals support
Date: Sun, 25 Feb 2024 14:44:55 -0800	[thread overview]
Message-ID: <CAH+w=7YBrjo=D6Pp9mXh8WQKkrTF0aRR4ddv59bhQjq6bO=Avw@mail.gmail.com> (raw)
In-Reply-To: <73696-1708812060.096751@IRYQ.G6d0.hkDI>

On Sat, Feb 24, 2024 at 2:01 PM Oliver Kiddle <opk@zsh.org> wrote:
>
> For consistency with ksh and bash, the naming is RTMIN, RTMIN+1 ...
> RTMAX-1, RTMAX. This means that each signal has an alternate name
> so on my system, RTMIN+31 is an alternate name for RTMAX-30.
>
> The patch also adds a -L option to kill similar to bash and ksh which
> prints signals with their numbers as a table.

It looks as if "kill -L" chooses the name with the smallest "absolute value"?

Some suggestions RE -L:
* Drop the right-paren after the signal number, so this output is easily parsed.
* List in columns first rather than across rows.
* Recognize terminal width and change number of columns.
* Print one column (of number-name pairs, obviously) if output is not
a terminal.

I know the "N) NAME" format is bash-reminiscent, but bash also puts
the "SIG" prefix on every name which this already does not.  Anyway
two of those three suggestions are clearly a moderate amount of extra
effort, so just throwing out there.

> On many systems, the
> real-time signals are not numbered contiguously with the earlier
> signals.

Does this mean we should consider making $signals an associative array
like $history?  That would remove the issue that $signals[2] = HUP,
etc., but maybe that's a backward-compat problem.

> Prior to this patch, kill -l uses the WIFSIGNALED and WTERMSIG
> macros to convert a return status to the corresponding signal. But
> zsh simply ORs the status with 0200 (128). So surely we need to
> look for that instead?

Does that mean that Functions/Misc/zargs needs to change the way it
interprets exit status?  There is a presumption that 129+ is "killed
by signal", that 255 is special, and that otherwise 254 is the largest
possible exit status.


  reply	other threads:[~2024-02-25 22:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 22:01 Oliver Kiddle
2024-02-25 22:44 ` Bart Schaefer [this message]
2024-02-27 19:25   ` Oliver Kiddle
2024-02-27 21:12     ` Bart Schaefer
2024-02-27 23:51       ` Oliver Kiddle
2024-02-28  2:17         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7YBrjo=D6Pp9mXh8WQKkrTF0aRR4ddv59bhQjq6bO=Avw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).