Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: History Up key
- X-seq: zsh-workers 13645
- From: Zefram <zefram@xxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: History Up key
- Date: Thu, 15 Mar 2001 19:15:47 +0000 (GMT)
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <Tc0a88d015249554427@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> from Peter Stephenson at "Mar 14, 2001 11:28:45 am"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
>+ /*
>+ * Sanity checking. If the cursor key is zero-length (unlikely,
>+ * but this is termcap we're talking about), or it's a single
>+ * character which is already bound, then we don't bind it.
>+ */
>+ if (!buf[0] || (!buf[1] && km->first[STOUC(buf[0])] != t_undefinedkey))
>+ ok = 0;
>+ else
>+ ok = 1;
>+ }
>+ if (!ok) {
> /* Assume the normal VT100-like values. */
> sprintf(buf, "\33[%c", defchar);
> }
Rather dodgy logic here. Surely we should be doing all-terminfo arrow
keys or all-VT100 arrow keys, not some combination.
And if we're going the way of arrow keys being bound by default, let's
have some documentation on how to remove those bindings, and let's make
it feasible. With this kind of logic in place (whether on a key-by-key
basis or affecting the whole set), simply unbinding the terminfo-derived
key sequences isn't sufficient. In fact, with the logic in the form
you propose above, there is no way to determine whether a binding of
a single-character arrow-key sequence comes from the arrow key or from
the default map, short of knowing the default map.
I suggest in any case a simplification that will ameliorate this problem:
just don't bind single-character arrow-key sequences, rather than only
avoiding such sequences that are already bound.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author