Skip to content

Commit dc2cf90

Browse files
committed
Emulate Unix like terminals that sends Alt+key as \e+key
1 parent 8f6aa3a commit dc2cf90

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/reline/windows.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ def self.process_key_event(repeat_count, virtual_key_code, virtual_scan_code, ch
226226
# no char, only control keys
227227
return if key.char_code == 0 and key.control_keys.any?
228228

229+
@@output_buf.push("\e".ord) if key.control_keys.include?(:ALT)
230+
229231
@@output_buf.concat(key.char.bytes)
230232
end
231233

0 commit comments

Comments
 (0)