Skip to content

Commit b2cc680

Browse files
committed
follow consolemode change
fix '#300'
1 parent 00021fa commit b2cc680

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/reline/windows.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ def self.check_input_event
235235
num_of_events = 0.chr * 8
236236
while @@output_buf.empty?
237237
Reline.core.line_editor.resize
238-
next if @@WaitForSingleObject.(@@hConsoleInputHandle, 100) != 0 # max 0.1 sec
238+
if @@WaitForSingleObject.(@@hConsoleInputHandle, 100) != 0 # max 0.1 sec
239+
# prevent for background consolemode change
240+
@@legacy_console = (getconsolemode() & ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0)
241+
next
242+
end
239243
next if @@GetNumberOfConsoleInputEvents.(@@hConsoleInputHandle, num_of_events) == 0 or num_of_events.unpack1('L') == 0
240244
input_record = 0.chr * 18
241245
read_event = 0.chr * 4

0 commit comments

Comments
 (0)