zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: Peter Stephenson <pws@csr.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: History Up key
Date: Thu, 15 Mar 2001 19:15:47 +0000 (GMT)	[thread overview]
Message-ID: <E14ddDv-00028R-00@crucigera.fysh.org> (raw)
In-Reply-To: <Tc0a88d015249554427@mailsweeper01.cambridgesiliconradio.com> from Peter Stephenson at "Mar 14, 2001 11:28:45 am"

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


  reply	other threads:[~2001-03-15 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E14cvJO-00084f-00@crucigera.fysh.org>
2001-03-13 21:57 ` Bart Schaefer
2001-03-14 11:28   ` Peter Stephenson
2001-03-15 19:15     ` Zefram [this message]
2001-03-15 19:27   ` Zefram
2001-03-17 22:31     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E14ddDv-00028R-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).