lib/rex/ui/text/output/stdio.rb in librex-0.0.54 vs lib/rex/ui/text/output/stdio.rb in librex-0.0.63
- old
+ new
@@ -1,6 +1,7 @@
require 'rex/ui'
+require 'windows_console_color_support'
module Rex
module Ui
module Text
@@ -16,19 +17,26 @@
when true
return true
when false
return false
else # auto
+ if (Rex::Compat.is_windows)
+ return true
+ end
term = Rex::Compat.getenv('TERM')
return (term and term.match(/(?:vt10[03]|xterm(?:-color)?|linux|screen|rxvt)/i) != nil)
end
end
#
# Prints the supplied message to standard output.
#
def print_raw(msg = '')
- $stdout.print(msg)
+ if (Rex::Compat.is_windows and supports_color?)
+ WindowsConsoleColorSupport.new($stdout).write(msg)
+ else
+ $stdout.print(msg)
+ end
$stdout.flush
msg
end
end