Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Unicode allowables in Environment variables



What's going on that causes Zsh to try to do wildcard expansion on the metafied value even inside quotation marks?

image.png

On Mon, Nov 4, 2024 at 1:13 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Mon, Nov 4, 2024 at 7:30 AM William DeShazer <earl.deshazer@xxxxxxxxx> wrote:
>
> It gets mangled inside /etc/zshrc_Apple_Terminal which is kicked off by /etc/zshrc. This code section is intended to synchronize with the new feature to have the Terminal.app Title bar auto update. In an effort to come up with a safe URL path, by adding this to a zsh hook, this code is mangling ZDOTDIR.

I can confirm that executing /etc/zshrc_Apple_Terminal during startup
appears to be messing up the local copy of the ZDOTDIR variable.
Interestingly, the value in the environment is not affected, so the
issue can be worked around by:

ZDOTDIR="$(printenv ZDOTDIR)"

This doesn't have anything to do with add-zsh-hook, it happens even if
that function is not executed.  Even an empty file will reproduce
this, and will do so on Ubuntu with the same sort of ZDOTDIR path.
valgrind reports no memory sloppiness, and it doesn't happen with a
random environment variable, so I think it's because ZDOTDIR is
retrieved during startup with getsparam_u() which unmetafies-in-place
the return value of getsparam() ... but I haven't tracked it any
further than that.



--
Mark J. Reed <markjreed@xxxxxxxxx>


Messages sorted by: Reverse Date, Date, Thread, Author