zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: PATCH: $signals
Date: Tue, 17 Nov 2015 10:27:45 +0000	[thread overview]
Message-ID: <20151117102745.06490c07@pwslap01u.europe.root.pri> (raw)

Musing for the Nth time on how we managed to design the $signals array
so that indices are off by one from signals, I noticed we don't even
document the fact.

pws

diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index b896e2d..00ee41f 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -771,7 +771,13 @@ Incremented by one each time a new shell is started.
 )
 vindex(signals)
 item(tt(signals))(
-An array containing the names of the signals.
+An array containing the names of the signals.  Note that with
+the standard zsh number of array indices, where the first element
+has index 1, the signals are offset by 1 from the signal number
+used by the operating system.  For example, on typical Unix-like systems
+tt(HUP) is signal number 1, but is referred to as tt($signals[2]).  This
+is because of tt(EXIT) at position 1 in the array, which is used
+internally by zsh but is not known to the operating system.
 )
 vindex(TRY_BLOCK_ERROR)
 item(tt(TRY_BLOCK_ERROR) <S>)(


                 reply	other threads:[~2015-11-17 10:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20151117102745.06490c07@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).