Add support for modes to shell bindings

Ref #508. Only supports zsh.