diff --git a/lib/os.rb b/lib/os.rb index 793ceb0..f859a76 100644 --- a/lib/os.rb +++ b/lib/os.rb @@ -176,11 +176,12 @@ def self.bsd? end def self.windows? - ENV['OS'] == 'Windows_NT' + # Windows 10 WSL kernel versions are custom to Microsoft + ENV['OS'] == 'Windows_NT' || !(`uname -r` =~ /Microsoft/).nil? end def self.linux? - OS.host_os =~ /linux/ ? true : false + !windows? && OS.host_os =~ /linux/ ? true : false end end