zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: print builtin preceded by parameter assignment
Date: Wed, 24 Apr 2019 09:00:54 -0700	[thread overview]
Message-ID: <CAH+w=7bpPRr3u=JA3QpAD9K=q7vcDUtz-rEEvz9OcLHpzmyzkQ@mail.gmail.com> (raw)
In-Reply-To: <20190424123144.GA21402@zira.vinc17.org>

On Wed, Apr 24, 2019 at 5:33 AM Vincent Lefevre <vincent@vinc17.net> wrote:
>
> There are several bugs (perhaps all related):
>
> 1. The fact that TZ remains exported with a value different
>    from $TZ.

This is not related (and is not actually the case).  TZ does not
remain exported.  What remains is that the settz() call has changed
the current timezone of the zsh process to be something that differs
from the value of the TZ environment variable.

>> 2. The fact that TZ and other variables (at least LC_ALL and CDPATH)
>    are handled differently with a variable assignment before a
>    builtin, when not exported.

This is also not really related.  CDPATH is not an environment string
in the first place, it's an internal variable used only by zsh; the
fact that it can be exported is irrelevant to the behavior.  The
difference with LC_ALL is that it is recognized as semantically
meaningful to the shell, so it has special code to invoke setlocale()
whenever it changes.  TZ is not specially handled in the same way.

> 3. The fact that for TZ, the "export" status has an effect on
>    the value taken into account in a builtin.

Underneath this comes down to a system library issue:  The library
behaves differently depending on whether settz() [or setlocale()] has
been called, and if it has not been, then it behaves differently
depending on whether the values are truly in the process environ
array.  Its questionable whether zsh can (or should) track and
special-case every environment variable that has such side-effects.

  reply	other threads:[~2019-04-24 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190410125753epcas1p4052249a86c562165e1fe2a485d70e70b@epcas1p4.samsung.com>
2019-04-10 12:55 ` Vincent Lefevre
2019-04-10 13:14   ` Peter Stephenson
2019-04-10 14:11     ` Vincent Lefevre
2019-04-10 14:39       ` Peter Stephenson
2019-04-10 17:25         ` Bart Schaefer
2019-04-11 10:40           ` Vincent Lefevre
2019-04-11 20:58             ` Bart Schaefer
2019-04-11 21:42               ` Bart Schaefer
2019-04-24 12:31                 ` Vincent Lefevre
2019-04-24 16:00                   ` Bart Schaefer [this message]
2019-04-25 19:47                     ` Bart Schaefer
2019-04-11 10:45         ` Vincent Lefevre

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=7bpPRr3u=JA3QpAD9K=q7vcDUtz-rEEvz9OcLHpzmyzkQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).