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

Re: emulate zsh *except* pushd related options



On Dec 23, 2015 6:30 AM, "Dominik Vogt" <vogt@xxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Dec 22, 2015 at 08:57:47PM -0800, Bart Schaefer wrote:
>
> >
> > The "emulate" command accepts the same "-o optionn_name" (or "+o") as
> > shell startup, so you can do
> >
> >     emulate -L zsh -o shwordsplit ...
>
> Unfortunately my zsh is too old for that.

You can substitute

local opts
opts=( ... )
emulate -L zsh
set $opts

> > For your specific use case, the current state of the pushd and cd
options
> > can be enumerated this way:
> >
> >     ${(Oa)${${(kv)options[(I)*pushd*|cd*|*cd]/off/+o}/on/-o}}

That should work in older zsh too, for the value of $opts above.


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