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

Re: Unintended side-effects of "emulate -c" ?

On Mar 4,  8:59pm, I wrote:
} Another less desirable unintended side-effect:
} torch% emulate zsh -c 'set -o vi'
} This is equivalent to "bindkey -v" and leaks out of the emulate scope.
Unfortunately for setopt vi / emacs, there's no way outside of the zle
module to tell which keymap is in effect.  Changing the setting of the
vi or emacs options changes the keymap, but changing the keymap (with
bindkey) does not change the options, so literally any keymap might
need to be restored.  Managing this from "emulate" would require at
least two new ZLE_CMD* entry points.

So for the time being I've punted, and asserted that you can't change
those two options with emulate.

} A similar thing happens with sunkeyboardhack and banghist.

As it turns out the only effect this has for banghist is a bit obscure;
history references continue to work but for a limited time the quoting
rules for "!" are changed.  This doesn't last long as inittyptab() gets
called almost ridiculously often, which eventually repairs it again.

Barton E. Schaefer

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