grml-etc-core icon indicating copy to clipboard operation
grml-etc-core copied to clipboard

Clarify how `zstyle -T ':grml:chpwd:dirstack'` is supposed to be set

Open nh2 opened this issue 2 years ago • 1 comments

For most zstyles, I can set them any time and then they apply.

But in https://github.com/grml/grml-etc-core/commit/d005e0b78bac79a566a3b16fb9e66b28bca48d61, the if zstyle -T ':grml:chpwd:dirstack' enable is on the top-level of .zshrc, so it will only be read once at the time of .zshrc evaluation:

https://github.com/grml/grml-etc-core/blob/d005e0b78bac79a566a3b16fb9e66b28bca48d61/etc/zsh/zshrc#L1600

I believe this means that it must be done in .zshrc.pre; later invocations setting that zstyle will have no effect at all.

Is this correct?

If yes, could it be changed such that zstyle ':grml:chpwd:dirstack' enable false works also in the user's normal .zshrc.local?

If not, it might make sense to extend the explanation in https://github.com/grml/grml-etc-core/commit/d005e0b78bac79a566a3b16fb9e66b28bca48d61#diff-0e012aed4e549254b0e807a707638324d4a262e96dc61bdcf75f10c6b17ce017R139 to explain this restriction.

nh2 avatar Feb 11 '22 13:02 nh2

Good point, thanks for raising this, @nh2.

Yes, zstyle ':grml:chpwd:dirstack' ... is indeed supposed to take place in .zshrc.pre and that's what I'm also using as such.

@ft any further ideas/information from your side? :)

mika avatar Feb 11 '22 16:02 mika