aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-09-12 04:51:08 +0900
committeraycabta <aycabta@gmail.com>2020-09-12 08:35:52 +0900
commit777d5367496bd1e8dad500685c0786a2572fc9e8 (patch)
tree561baf5fa82acf1836a4d5a32fa4b052455e7f8d /lib
parentf36dc2b6de54ec6b82766d2134a782d12628a2b9 (diff)
downloadruby-777d5367496bd1e8dad500685c0786a2572fc9e8.tar.gz
[ruby/reline] Support for word movement escape sequences in iTerm2
https://github.com/ruby/reline/commit/187235f88c
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/ansi.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index 8b6b10cb89..80fccd74f9 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -38,6 +38,12 @@ class Reline::ANSI
# Del is 0x08
# Arrow keys are the same of KDE
+ # iTerm2
+ [27, 27, 91, 67] => :em_next_word, # Option+→
+ [27, 27, 91, 68] => :ed_prev_word, # Option+←
+ [195, 166] => :em_next_word, # Option+f
+ [195, 162] => :ed_prev_word, # Option+b
+
# others
[27, 32] => :em_set_mark, # M-<space>
[24, 24] => :em_exchange_mark, # C-x C-x TODO also add Windows