From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28731 invoked from network); 15 Mar 2001 19:15:58 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Mar 2001 19:15:58 -0000 Received: (qmail 23860 invoked by alias); 15 Mar 2001 19:15:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13645 Received: (qmail 23849 invoked from network); 15 Mar 2001 19:15:51 -0000 Subject: Re: History Up key In-Reply-To: from Peter Stephenson at "Mar 14, 2001 11:28:45 am" To: Peter Stephenson Date: Thu, 15 Mar 2001 19:15:47 +0000 (GMT) CC: Zsh hackers list X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: From: Zefram 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