Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Completion: Don't prepend SIG to numeric signals in _signals
- X-seq: zsh-workers 43134
- From: dana <dana@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: [PATCH] Completion: Don't prepend SIG to numeric signals in _signals
- Date: Mon, 2 Jul 2018 10:52:38 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=5tWXxo40HcgfsK6wxv0bgppauywlHPHJWSNZkG8wrpo=; b=WuAvYsSRdci8Dh7/2Nc9/UqpelfvAveP7dAKpdLDbLiRZFUWERWbl/i4P5HCJ4Ft8X HgqlEIk/IcX0h/4562Pm8oGifClpVAestTF1aqRdiKPZ+QdNVW/1Xj5IoWkUJ52kwcvl o72bfip94jIpU2PfNFV69pRx2I5ZV6RiLLh+2hKKcWchHOICl+AH3WIKzFsTqBnOAZjf khV6cIGkqh+OwGVRfCiQ9GsjlvGb3jbvxAUDc9p/H1pO08tUNdWxYut4C1AZsanNej/E GwW6N1Bu4HMGT2Y90s1kS/CbJwQxrWAf/N23XxR3kTGZPG66I5kLYK+TA7dxpWfR44tc 8F0Q==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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=()
Messages sorted by:
Reverse Date,
Date,
Thread,
Author