Re: TMPDIR vs TMPPREFIX again
"Mark J. Reed" <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <CAA=-s3wJBEmUpWm9jC=gx5kbLnHBL+rUoygy+V7hNB-mRt6o2Q@mail.gmail.com> |
How does TMPPREFIX get initialized? At least on my Mac, it's not set in the
environment before zsh starts - but TMPDIR is, set by the OS. It seems like
in that case zsh should initialize TMPPREFIX using TMPDIR instead of
/tmp. If I were writing the initialization as a shell command I'd probably
go with this:
*: "${TMPPREFIX:=${TMPDIR:-/tmp}/zsh}}" *
On Thu, Aug 13, 2026 at 11:17 PM Mikael Magnusson <[email protected]> wrote:
> On Thu, Aug 13, 2026 at 9:52 PM Daniel Colascione <[email protected]>
> wrote:
> >
> > Might it be possible (as others have suggested over the years) to
> > incorporate TMPDIR into TMPPREFIX so that zsh works properly when run in
> > an environment with read-only /tmp but writable TMPDIR?
>
> How would that work in practice?
>
> % echo $TMPPREFIX
> /tmp/zsh
> % echo $TMPDIR
>
> % TMPDIR=/foo/tmp
> % echo $TMPPREFIX # do you expect this to be different now? what if
> the user had set it manually? etc?
>
> It is also really trivial to just set TMPPREFIX yourself to whatever
> value you want, no?
>
> --
> Mikael Magnusson
>
>
--
Mark J. Reed <[email protected]>