summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/reline/windows.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb
index 50cfe3f7df..46f8795daa 100644
--- a/lib/reline/windows.rb
+++ b/lib/reline/windows.rb
@@ -85,6 +85,7 @@ class Reline::Windows
end
end
+ VK_RETURN = 0x0D
VK_MENU = 0x12
VK_LMENU = 0xA4
VK_CONTROL = 0x11
@@ -207,7 +208,12 @@ class Reline::Windows
elsif char_code == 0 and control_key_state != 0
# unknown
else
- @@output_buf.concat(char.bytes)
+ case virtual_key_code
+ when VK_RETURN
+ @@output_buf.push("\n".ord)
+ else
+ @@output_buf.concat(char.bytes)
+ end
end
end