Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/reline/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ def self.decide_io_gate
require 'reline/io/ansi'

case RbConfig::CONFIG['host_os']
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
when /mswin|mingw|bccwin|wince|emc/
require 'reline/io/windows'
io = Reline::Windows.new
if io.msys_tty?
# stdin is a Cygwin/MSYS pty pipe (e.g. mintty): no console handle
# exists, and the pty speaks ANSI.
Reline::ANSI.new
else
io
end
else
# Ruby built with the msys/cygwin runtime also reaches here. Its tty layer
# speaks ANSI in any terminal (mintty pty or Windows console), so the
# Win32 console API must not be used. https://github.com/ruby/reline/issues/903
Reline::ANSI.new
end
end
Expand Down
Loading