From 057ab5f056bb310e324a48ca0aed2ee5231bcbd2 Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 3 Sep 2021 03:30:36 +0900 Subject: [PATCH] [ruby/reline] Emulate Unix like terminals that sends Alt+key as \e+key https://github.com/ruby/reline/commit/dc2cf90fa6 --- lib/reline/windows.rb | 2 ++ 1 file changed, 2 insertions(+) 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