Skip to content

Commit

Permalink
Mintty on Cygwin isn't a kind of command prompt, can process ANSI esc…
Browse files Browse the repository at this point in the history
…ape code
  • Loading branch information
aycabta committed Nov 20, 2019
1 parent 12aa801 commit 89f55a4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ module Reline
CursorPos = Struct.new(:x, :y)

class Core
if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
IS_WINDOWS = true
else
IS_WINDOWS = false
end

ATTR_READER_NAMES = %i(
completion_append_character
basic_word_break_characters
Expand Down Expand Up @@ -400,9 +394,15 @@ def self.line_editor
HISTORY = History.new(core.config)
end

if Reline::Core::IS_WINDOWS
if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
require 'reline/windows'
Reline::IOGate = Reline::Windows
if Reline::Windows.get_screen_size == [0, 0]
# Maybe Mintty on Cygwin
require 'reline/ansi'
Reline::IOGate = Reline::ANSI
else
Reline::IOGate = Reline::Windows
end
else
require 'reline/ansi'
Reline::IOGate = Reline::ANSI
Expand Down

0 comments on commit 89f55a4

Please sign in to comment.