Writing directly to console maintains color codes
I have a command that writes to the console. The image shows the bash color codes working. create is green
RailsAppGenerator::AppGenerator.start(opts, destination_root: destination_root)
Writing to console via a captured string, looses the color codes
If I capture the console to a variable and then write the variable back to $stdout, the console does not show colors.
capture_console do
RailsAppGenerator::AppGenerator.start(opts, destination_root: destination_root)
end
def capture_console
$stdout = StringIO.new
yield
@console_output = $stdout.string
$stdout.close
STDOUT.puts @console_output
ensure
$stdout = STDOUT # save_stdout
end

