Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: real-time signals support
- X-seq: zsh-workers 52626
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: real-time signals support
- Date: Wed, 28 Feb 2024 00:51:14 +0100
- Archived-at: <https://zsh.org/workers/52626>
- In-reply-to: <CAH+w=7Z-18+FkppsqHExRjtiW6Cy6AOFeNu_FX08r7Xekjk=eg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <73696-1708812060.096751@IRYQ.G6d0.hkDI> <CAH+w=7YBrjo=D6Pp9mXh8WQKkrTF0aRR4ddv59bhQjq6bO=Avw@mail.gmail.com> <14804-1709061923.292710@qlv_.smDE.ovA0> <CAH+w=7Z-18+FkppsqHExRjtiW6Cy6AOFeNu_FX08r7Xekjk=eg@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author