zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: real-time signals support
Date: Tue, 27 Feb 2024 13:12:09 -0800	[thread overview]
Message-ID: <CAH+w=7Z-18+FkppsqHExRjtiW6Cy6AOFeNu_FX08r7Xekjk=eg@mail.gmail.com> (raw)
In-Reply-To: <14804-1709061923.292710@qlv_.smDE.ovA0>

On Tue, Feb 27, 2024 at 11:25 AM Oliver Kiddle <opk@zsh.org> wrote:
>
> Bart Schaefer wrote:
> > Some suggestions RE -L:
>
> I'm not especially attached to any particular format here. If you or
> someone else wants to change it I'm not going to object.

I'm not strongly attached either, just used to seeing numbered lists
go down the "page".

> > * Drop the right-paren after the signal number, so this output is easily parsed.
>
> Is parsing kill -L output really that useful?

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 }} }} }} )

Anyway all of these were ideas that popped up as I was reading and
thinking about using the output after applying the patch, keep or
discard as preferred.

> > * List in columns first rather than across rows.
>
> I normally prefer columns first but with the RT signals, I think I
> actually prefer them at the bottom where they're easier to ignore.

Fair enough.

> > * Recognize terminal width and change number of columns.
>
> Ksh also does this. Not entirely to my taste on a wide terminal but I
> usually like my terminal windows narrow and tall anyway.

The main reason is for terminals narrower than 80-ish columns; wider ones, meh.

> > * Print one column (of number-name pairs, obviously) if output is not
> > a terminal.
>
> We don't adjust output for non-terminals from any other builtin.

Also reasonable.  Fixable by asserting a COLUMNS= value if the width
is recognized.

> I couldn't see the point of the "SIG" prefix - adds no information but
> makes it harder to spot particular values.

Exactly; my point was that we're already not a perfect copy of
bash/ksh here, so going further afield is not precluded.

> 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?
Negative signals translate into the absolute value sent to the process
group leader, right?

% (exit -2)
% echo $?
254


  reply	other threads:[~2024-02-27 21:12 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
2024-02-27 19:25   ` Oliver Kiddle
2024-02-27 21:12     ` Bart Schaefer [this message]
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=7Z-18+FkppsqHExRjtiW6Cy6AOFeNu_FX08r7Xekjk=eg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --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).