[Pkg-zsh-devel] Bug#794967: zsh: please enhance /etc/zshrc

Frank Terbeck ft at bewatermyfriend.org
Sat Aug 8 21:46:34 UTC 2015


Carsten Hey wrote:
[...]
>  * Please add some additional keybindings, at least for the emacs keymap:
>
>    - bind PageUp "${terminfo[kpp]}" to history-search-backward
>    - bind PageDown "${terminfo[knp]}" to history-search-forward
>    - bind BackTabKey "${terminfo[kcbt]}" to reverse-menu-complete

I firmly believe, that a vendor's *global* setup file should be as
minimal as possible, which is why I really don't want to add anything
that's more than making the zsh defaults behave more robustly across
multiple terminals or deal with stuff specific to Debian.

This is stuff for the recommended setup file.

>      In terminfo(5), the capname cbt is described as "back tab (P)"
>      and kcbt is described as "back-tab key", therefore the suggested
>      'BackTabKey' instead of 'BackTab' - even though grml confuses
>      people that know terminfo(5) by using 'BackTab' as name.

By that logic, kpp would need to be mapped to "PreviousPageKey". I think
the current naming is fine.

>    - Maybe F1 could invoke run-help?  But then the output of run-help
>      w/o arguments should be more useful for new users.
>
>    - Red Hat maps or mapped space to magic-space, I think Debian should
>      _not_ do this, but initially I thought that this would be a good
>      idea.

Again, this fits into the recommended setup file

>  * $key should be unset unless there is a reason for not doing so.

The reason I left it set, is because its layout matches the $key
dictionary, that zsh's "zkbd" function produces and can be used as a
drop-in replacement. I still think that's a reasonable idea, even though
it slightly violates the "A vendor's global setup needs to be minimal"
rule.

>  * (( ${+aliases[run-help]} )) requires the zsh/parameter module.  If,
>    in rare cases, possibly involving zsh-static, there is a chance that
>    this module is not loaded successfully, you should consider doing
>    this instead to remove the alias w/o error message:
>
>      alias run-help=
>      unalias run-help

That's a good point. I think we can do it like this:

    unhash -a -m 'run-help' || true

-a removes alias from its hash table. -m uses the argument as a pattern.
Since there's no character that's significant to pattern matching, this
will work. This way, there is no error message. The '|| true' is to make
sure the setup file exits with successful status.

We could also just do this:

    unalias run-help 2>/dev/null || true

…if that's more straight-forward to read.


Regards, Frank



More information about the Pkg-zsh-devel mailing list