zsh-users
 help / color / mirror / code / Atom feed
* Zle "ctrl-v" quoting bug?
@ 1998-07-04 16:24 Johan Sundström
  1998-07-04 18:49 ` Dan Nelson
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Sundström @ 1998-07-04 16:24 UTC (permalink / raw)
  To: zsh mailinglist

Phew!

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

I, for one, would find quoting the given keystroke more intuitive. If
this isn't a bug, please explain the logic in this behaviour (it just
might be some kind of a great feature...).

/Johan Sundström, running zsh 3.0.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Zle "ctrl-v" quoting bug?
  1998-07-04 16:24 Zle "ctrl-v" quoting bug? Johan Sundström
@ 1998-07-04 18:49 ` Dan Nelson
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Nelson @ 1998-07-04 18:49 UTC (permalink / raw)
  To: johan_sundstrom, zsh mailinglist

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-07-04 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-04 16:24 Zle "ctrl-v" quoting bug? Johan Sundström
1998-07-04 18:49 ` Dan Nelson

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).