class Rex::Ui::Text::Output::Stdio
This class implements output against standard out.
Public Instance Methods
print_raw(msg = '')
click to toggle source
Prints the supplied message to standard output.
# File lib/rex/ui/text/output/stdio.rb, line 37 def print_raw(msg = '') if (Rex::Compat.is_windows and supports_color?) WindowsConsoleColorSupport.new($stdout).write(msg) else $stdout.print(msg) end $stdout.flush msg end
supports_color?()
click to toggle source
# File lib/rex/ui/text/output/stdio.rb, line 19 def supports_color? case config[:color] 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