zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@emsphone.com>
To: johan_sundstrom@bigfoot.com, zsh mailinglist <zsh-users@math.gatech.edu>
Subject: Re: Zle "ctrl-v" quoting bug?
Date: Sat, 4 Jul 1998 13:49:02 -0500	[thread overview]
Message-ID: <19980704134902.A23665@emsphone.com> (raw)
In-Reply-To: =?iso-8859-1?Q?=3C359E5734=2E5232B667=40bigfoot=2Ecom=3E=3B_from_=22Joha?= =?iso-8859-1?Q?n_Sundstr=F6m=22_on_Sat_Jul__4_18:24:20_GMT_1998?=

In the last episode (Jul 04), Johan Sundström said:
> I finally managed to bind shift-tab to reverse-menu-complete in Linux
> console mode, through tweaking a bit with my keymap and binding
> meta-tab to shift-tab. However, when trying to quote alt-tab using
> control-v alt-tab, an escape character is quoted (^[), and a beep is
> sent to the speaker, instead of generating the entire sequence ^[^I.
> How is that?
> 
> Similarly, I can't quote the tab character this way. Control-v tab or
> control-v control-i generates an unquoted tab

It's doing exactly what you asked for:  Control-V just inserts the very
next key into the buffer, without parsing it.  "^V Tab" sticks a raw
tab into your commandline (instead of trying to do a menucomplete). 
"^V ESC" sticks a raw escape into your commandline, but since you can't
usually see an escape, it prints "^[" instead.  Not that this is not
the two characters ^ and [, but one ESC character, printed so you can
see it.

If you try to "insert" an "ESC Tab" combo, the ^V only applies to the
ESC, since zsh has no idea that you redefined SHIFT-Tab to send two
control characters.  The only reason that things like "^V DOWN" or "^V
F1" work is that only the first character in those sequences is a
zsh-special character that needs to be inserted via ^V.

You might want to bind SHIFT-Tab to "ESC [ Z", which seems to be the
ANSI standard escape sequence for "Cursor Backward Tab", and add the
following to your termcap entry (if it's not already there): "bt=\E[Z".
Then add 

    bindkey ${$(echotc bt 2>&-):-"^[[Z"} reverse-menu-complete

to your startup file.  That'll let other terminals redefine backtab if
necessary, but will default to "ESC [ Z" if the 'bt' capability is
missing. 

	-Dan Nelson
	dnelson@emsphone.com


      reply	other threads:[~1998-07-04 19:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-04 16:24 Johan Sundström
1998-07-04 18:49 ` Dan Nelson [this message]

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=19980704134902.A23665@emsphone.com \
    --to=dnelson@emsphone.com \
    --cc=johan_sundstrom@bigfoot.com \
    --cc=zsh-users@math.gatech.edu \
    /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).