Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zle "ctrl-v" quoting bug?
- X-seq: zsh-users 1663
- From: Dan Nelson <dnelson@xxxxxxxxxxxx>
- To: johan_sundstrom@xxxxxxxxxxx, zsh mailinglist <zsh-users@xxxxxxxxxxxxxxx>
- Subject: Re: Zle "ctrl-v" quoting bug?
- Date: Sat, 4 Jul 1998 13:49:02 -0500
- In-reply-to: <359E5734.5232B667@xxxxxxxxxxx>; from "Johan Sundström" on Sat Jul 4 18:24:20 GMT 1998
- References: <359E5734.5232B667@xxxxxxxxxxx>
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@xxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author