Fix color change issue during output redirection

When command output is redirected to a file, console info is not available to set the colors resulting in a crash.
This is fixed with this change.
Merge pull request #1 from shivakumargn/master

Fix color change issue during output redirection