summaryrefslogtreecommitdiff
path: root/lib/reline
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-09-03 03:30:36 +0900
committergit <svn-admin@ruby-lang.org>2021-09-03 04:27:53 +0900
commit057ab5f056bb310e324a48ca0aed2ee5231bcbd2 (patch)
treeb697a1ccc4c10e0dcc3f93b415165ae7ec985290 /lib/reline
parent9e0caba187746acb03449ea5b08334cd6b68ea0a (diff)
downloadruby-057ab5f056bb310e324a48ca0aed2ee5231bcbd2.tar.gz
[ruby/reline] Emulate Unix like terminals that sends Alt+key as \e+key
https://github.com/ruby/reline/commit/dc2cf90fa6
Diffstat (limited to 'lib/reline')
-rw-r--r--lib/reline/windows.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb
index b3443aa1ba..642f33aedf 100644
--- a/lib/reline/windows.rb
+++ b/lib/reline/windows.rb
@@ -226,6 +226,8 @@ class Reline::Windows
# no char, only control keys
return if key.char_code == 0 and key.control_keys.any?
+ @@output_buf.push("\e".ord) if key.control_keys.include?(:ALT)
+
@@output_buf.concat(key.char.bytes)
end