zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [bug] Special parameters $PATH and $path aren't kept in sync after emulating sh
Date: Mon, 9 Nov 2020 10:07:25 +0000 (GMT)	[thread overview]
Message-ID: <1101218972.1247457.1604916445509@mail2.virginmedia.com> (raw)
In-Reply-To: <a342172f5c6b83d74cba750b45e1dbb6@waegenei.re>

> On 09 November 2020 at 07:27 Brice Waegeneire <brice@waegenei.re> wrote:
> Yesterday I stumbled upon a bug where setting $PATH when emulating
> sh would would break the variable synchronization between the string
> ($PATH) and the array ($path):

sh mode doesn't have the special variable path; you need to rely exclusively
on PATH within sh emulation.  The basic idea of sh emulation is to track
POSIX as closely as possible to make sure all the basics work --- it's
not designed as an all-singing-all-dancing smart shell in the same
way normal zsh mode is.  In this case, that means we try to make sure variables
people might use unsuspectingly in sh don't get overloaded with special
behaviour.  (Having said that, zsh is written in such a way there are various
places where we can't make sh emulation work properly, but that's going rather
beyond your issue.)

Hooking up normal zsh behaviour and sh behaviour together can be a bit
of a nuisance exactly because, by design, they work differently.  So if
you've got a workaround, I'm afraid that may be as good as it gets.

pws


  reply	other threads:[~2020-11-09 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  7:27 Brice Waegeneire
2020-11-09 10:07 ` Peter Stephenson [this message]
2020-11-09 10:22 ` Daniel Shahaf

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=1101218972.1247457.1604916445509@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.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).