summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/X02zlevi.ztst7
-rw-r--r--Test/X03zlebindkey.ztst22
2 files changed, 29 insertions, 0 deletions
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 203c13c32..ccfb7b1c6 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -596,6 +596,13 @@
>BUFFER: 1ls `2` $(3) "4" $'5' ${6}
>CURSOR: 0
+ zpty_run 'bindkey -s -a "cw" "dwi"'
+ zletest $'one two\e0cwyksi'
+ zpty_run 'bindkey -r -a "cw"'
+0:for a vi command, wait to allow a longer binding to be used
+>BUFFER: yksitwo
+>CURSOR: 4
+
%clean
zmodload -ui zsh/zpty
diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst
index 5277332a7..1b63b3920 100644
--- a/Test/X03zlebindkey.ztst
+++ b/Test/X03zlebindkey.ztst
@@ -37,6 +37,28 @@
>"^Xy" "bar"
>"^Xy" undefined-key
+ zpty_run 'bindkey -s "\e[" altbracket'
+ zletest $'$\C-A\e[17~'
+ zpty_run 'bindkey -r "\e["'
+0:binding to CSI introduction is not used if a full sequence arrives
+>BUFFER: $
+>CURSOR: 0
+
+ zpty_run 'bindkey -s "\e[1" altbracketone'
+ zletest $'$\C-A\e[17~'
+ zpty_run 'bindkey -r "\e[1"'
+0:binding to longer prefix of a CSI sequence is used
+# we assume the user knows what they're doing
+>BUFFER: altbracketone7~$
+>CURSOR: 15
+
+ zpty_run 'bindkey -s "\e[" altbracket'
+ zletest $'$\C-A\e[177'
+ zpty_run 'bindkey -r "\e["'
+0:use prefix binding where we don't have a CSI sequence
+>BUFFER: altbracket177$
+>CURSOR: 13
+
# As we're only looking at definitions here, we don't
# bother using the pseudo-terminal; just test in the normal fashion.
bindkey -e