aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/bind.expect
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-24 20:42:50 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-25 12:05:39 -0700
commitd1208386d21e4e85fa99538fef0bf23475a3c3e1 (patch)
treef680858003a08e79f1a6d0875914f463964d4e91 /tests/bind.expect
parentd7a4838a545beebad3786eb9289a04f87de480b6 (diff)
tty driver ignore lnext (\cV) and werase (\cW)
Configure the tty driver to ignore the lnext (\cV) and werase (\cW) characters so they can be bound to fish functions. Correct the `fish_key_bindings` program to initialize the tty in the same manner as the `fish` program. Fixes #3064
Diffstat (limited to 'tests/bind.expect')
-rw-r--r--tests/bind.expect20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/bind.expect b/tests/bind.expect
index 7589fa8e..7c594241 100644
--- a/tests/bind.expect
+++ b/tests/bind.expect
@@ -199,3 +199,23 @@ expect_prompt -re {\r\nmno pqrt\r\n} {
} unmatched {
puts stderr "emacs transpose words fail, 100ms timeout: long delay"
}
+
+# Verify special characters, such as \cV, are not intercepted by the kernel
+# tty driver. Rather, they can be bound and handled by fish.
+send "bind \\cV 'echo ctrl-v seen'\r"
+expect_prompt
+send "\026\r"
+expect_prompt -re {ctrl-v seen} {
+ puts "ctrl-v seen"
+} unmatched {
+ puts stderr "ctrl-v not seen"
+}
+
+send "bind \\cO 'echo ctrl-o seen'\r"
+expect_prompt
+send "\017\r"
+expect_prompt -re {ctrl-o seen} {
+ puts "ctrl-o seen"
+} unmatched {
+ puts stderr "ctrl-o not seen"
+}