Zsh Mailing List Archive
Messages sorted by:
Re: How to detect that Zsh startup is result of exec zsh?
- X-seq: zsh-users 21915
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: How to detect that Zsh startup is result of exec zsh?
- Date: Thu, 15 Sep 2016 08:31:03 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fNe2EdEySMdTnh7JtZqEGadbbkEeRFebq0siOMy5pA0=; b=CjYraJi67XxxFon0FoETLJUNu/wUg/vWoJmZHrrxLYahbLIE3IQbT2oc/iuaLAQm52 vhQz1KwYq1daJahF0jAn1L5pj49s4X98k7XUQ1vz6nL/W7STa7Y8SFrikW3yjbdNbXIl PJlzSsc7Jc39CQFTJU3R5OSxMpuDTMLo7mhdl87B4G81M+I3p0m9k5Z5cFMjCcKrD7Kg 3wz/jziMM2Dhsjq7m+n5dVLGJHJkUV+vHx2rxyI7jZRwhQaScCLTXd4G8CrT/gBfm1lz LQnDqTRguR0AWd19lOjH4vMoH81mubnvGPQHF7ji36OJHSIxK5xGd8D57Ab174eUYLAu kWPA==
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20160913122504eucas1p121867b112b7f08e125a324230d8296df@eucas1p1.samsung.com> <CAKc7PVCErL0ZykRG-72foh8URN1UsO9jvPHuxiCDkum_pooXYg@mail.gmail.com> <email@example.com> <CAKc7PVAGqeJK=kdpQ9hSBcgpJmn639X94BU0CoNR2m6L2VBfcg@mail.gmail.com> <firstname.lastname@example.org>
On 13 September 2016 at 15:30, Peter Stephenson
> BTW, telling you're in a subshell when you're still in the parent shell
> is actually easy:
> zmodload zsh/system
> if (( $$ == $sysparams[pid] )); then
> print "I'm in the parent shell"
> print "I'm in a subshell"
> However, that's too early for you --- you need to know at the start of
> the new zsh. I think some external mapping to PIDs is the only reliable
For me the two values are always the same:
This reminds me $ZSH_SUBSHELL that Mikael proposed, which is always 0 for me:
Testing this on IRC bot gave correct result, i.e. "1" was assigned
after running zsh IIRC. So maybe this is OS X issue, maybe even the
same in both cases?
Messages sorted by: