diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-05-24 20:42:50 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-05-25 12:05:39 -0700 |
commit | d1208386d21e4e85fa99538fef0bf23475a3c3e1 (patch) | |
tree | f680858003a08e79f1a6d0875914f463964d4e91 /tests | |
parent | d7a4838a545beebad3786eb9289a04f87de480b6 (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')
-rw-r--r-- | tests/bind.expect | 20 | ||||
-rw-r--r-- | tests/bind.expect.out | 2 |
2 files changed, 22 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" +} diff --git a/tests/bind.expect.out b/tests/bind.expect.out index f74d54b2..07f09fde 100644 --- a/tests/bind.expect.out +++ b/tests/bind.expect.out @@ -13,3 +13,5 @@ default-mode custom timeout set correctly emacs transpose words, 100ms timeout: no delay emacs transpose words, 100ms timeout: short delay emacs transpose words, 100ms timeout: long delay +ctrl-v seen +ctrl-o seen |