Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bindkey -s '^[[18~' '^d^c'

On Thu, 20 Mar 2014 12:18:41 +0000 (UTC)
zzapper <david@xxxxxxxxxxxxxx> wrote:
> I want to put   ^d^c onto a function key but
> bindkey -s '^[[18~' '^d^c'
> doesn't work I think because the ^d^c substitute is somehow interpreted.

Yes, the second string is interpreted like the first, so ^d becomes Ctrl
d and ^c becomes Ctrl c.  You need to quote them, i.e. you need two
layers of quoting, the one you've got for the comand line, plus another
level for key interpretation.

  bindkey -s '^[[18~' '\^d\^c'

The manual does say this if you persist, but there's no pointer from the
entry for the -s option to tell you the information's there.

diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 127b4c4..0cca7bc 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -252,6 +252,9 @@ Bind each var(in-string) to each var(out-string).
 When var(in-string) is typed, var(out-string) will be
 pushed back and treated as input to the line editor.
 When tt(-R) is also used, interpret the var(in-string)s as ranges.
+Note that both var(in-string) and var(out-string) are subject to the same
+form of interpretation, as described below.
 item(var(in-string command) ...)(
 Bind each var(in-string) to each var(command).


Messages sorted by: Reverse Date, Date, Thread, Author