zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Zsh workers <zsh-workers@zsh.org>
Subject: [PATCH] Completion: Don't prepend SIG to numeric signals in _signals
Date: Mon, 2 Jul 2018 10:52:38 -0500	[thread overview]
Message-ID: <F4153EE4-EB54-405B-9D2B-A8C9F5F1ED2C@dana.is> (raw)

On the subject of _signals, an issue i noticed is that sometimes zsh doesn't
have the symbolic name for all signals.* `_signals -s` doesn't account for this,
and produces weird results like 'SIG16'. Technically most tools that deal with
signals will accept these, since they just blindly strip off the 'SIG' and use
whatever's left over, but it's weird and AFAIK any support for them is
incidental and undocumented. I think they should be filtered out.

* Ubuntu's zsh 5.4 is missing symbolic names for SIGSTKFLT and SIGPWR. If i
  build from source, they're there, and the scripts that generate the signals
  basically haven't changed in 20 years... so i'm not sure what's up with that.
  Maybe the system that Ubuntu used to build zsh had weird headers.

PS: I noticed that zsh doesn't even *know* about SIGRTMIN through SIGRTMAX
(they're neither listed in $signals nor accepted by kill), probably because
they're defined weirdly in the headers. bash and procps both do, though
`/bin/kill -l` doesn't show them. I might see if they're easy to add.

dana


diff --git a/Completion/Unix/Type/_signals b/Completion/Unix/Type/_signals
index df9a2f339..ffb01eba0 100644
--- a/Completion/Unix/Type/_signals
+++ b/Completion/Unix/Type/_signals
@@ -36,7 +36,7 @@ if [[ -z "$minus" ]] ||
   fi
 
   if [[ -n "$pre" && $PREFIX = ${minus}S* ]]; then
-    sigs=( "${minus}SIG${(@)^signals[first,last]}" )
+    sigs=( "${minus}SIG${(@)^${(@)signals[first,last]:#<->}}" )
     (( $#disp )) && tmp=( "$tmp[@]" "${(@)signals[first,last]}" )
   else
     sigs=()


             reply	other threads:[~2018-07-02 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180702155313epcas2p161b67990a718b040929bef8556974a47@epcas2p1.samsung.com>
2018-07-02 15:52 ` dana [this message]
2018-07-02 16:38   ` Peter Stephenson
2018-07-02 16:43     ` dana

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=F4153EE4-EB54-405B-9D2B-A8C9F5F1ED2C@dana.is \
    --to=dana@dana.is \
    --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).