zsh-users
 help / color / mirror / code / Atom feed
* Why is path not a -aUT type?
@ 2022-05-31 11:16 Zach Riggle
  2022-05-31 12:30 ` Andreas Kusalananda Kähäri
  2022-05-31 17:22 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Zach Riggle @ 2022-05-31 11:16 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

It seems to me that having duplicate entries in $PATH / $path is a bit
silly, and makes some things hard to do.

Is there any reason that, by default, we do not

typeset -aUT PATH path


Automatically?

*Zach Riggle*

[-- Attachment #2: Type: text/html, Size: 559 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is path not a -aUT type?
  2022-05-31 11:16 Why is path not a -aUT type? Zach Riggle
@ 2022-05-31 12:30 ` Andreas Kusalananda Kähäri
  2022-05-31 17:22 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Kusalananda Kähäri @ 2022-05-31 12:30 UTC (permalink / raw)
  To: Zach Riggle; +Cc: Zsh Users

On Tue, May 31, 2022 at 06:16:17AM -0500, Zach Riggle wrote:
> It seems to me that having duplicate entries in $PATH / $path is a bit
> silly, and makes some things hard to do.
> 
> Is there any reason that, by default, we do not
> 
> typeset -aUT PATH path
> 
> 
> Automatically?
> 
> *Zach Riggle*

PATH is no array, so "typeset -a" feels wrong.
PATH and path are already tied by default, no?

As for "typeset -U", that's useful to have, but I can definitely see
that one may want to e.g. temporarily add a directory path at the start
of PATH/path and then remove it again without disturbing the old values
of the variables.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is path not a -aUT type?
  2022-05-31 11:16 Why is path not a -aUT type? Zach Riggle
  2022-05-31 12:30 ` Andreas Kusalananda Kähäri
@ 2022-05-31 17:22 ` Bart Schaefer
  2022-05-31 17:44   ` Lawrence Velázquez
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2022-05-31 17:22 UTC (permalink / raw)
  To: Zach Riggle; +Cc: Zsh Users

On Tue, May 31, 2022 at 4:16 AM Zach Riggle <zachriggle@gmail.com> wrote:
>
> Is there any reason that, by default, we do not
>
> typeset -aUT PATH path

The main one is that PATH is imported from the environment and it's
messy to immediately mung it and push it back there before we've even
finished the rest of pre-RC-file shell initialization.  Further, it's
not up to us to decide how that value should be passed through to
child processes when zsh is used as a launcher by/for some other
application.

Not directly relevant to your intent, but "typeset -T XX xx" implies
that xx is an array, the -a option is not needed (and as Andreas
points out, wrong for XX).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is path not a -aUT type?
  2022-05-31 17:22 ` Bart Schaefer
@ 2022-05-31 17:44   ` Lawrence Velázquez
  0 siblings, 0 replies; 4+ messages in thread
From: Lawrence Velázquez @ 2022-05-31 17:44 UTC (permalink / raw)
  To: Bart Schaefer, Zach Riggle; +Cc: zsh-users

On Tue, May 31, 2022, at 1:22 PM, Bart Schaefer wrote:
> On Tue, May 31, 2022 at 4:16 AM Zach Riggle <zachriggle@gmail.com> wrote:
>>
>> Is there any reason that, by default, we do not
>>
>> typeset -aUT PATH path
>
> The main one is that PATH is imported from the environment and it's
> messy to immediately mung it and push it back there before we've even
> finished the rest of pre-RC-file shell initialization.  Further, it's
> not up to us to decide how that value should be passed through to
> child processes when zsh is used as a launcher by/for some other
> application.

It's also presumptuous to assume that all users want this.
I actually stopped deduplicating PATH/path recently because I want
to know when some application or other is trying to modify it behind
my back without having zsh possibly deduplicate the evidence away.

-- 
vq


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-31 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 11:16 Why is path not a -aUT type? Zach Riggle
2022-05-31 12:30 ` Andreas Kusalananda Kähäri
2022-05-31 17:22 ` Bart Schaefer
2022-05-31 17:44   ` Lawrence Velázquez

Code repositories for project(s) associated with this 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).