rbsec/dnscan

ANSI colour control sequences show as garbage on Windows

Closed this issue · 4 comments

On Windows neither CMD or PowerShell support ANSI colour control sequences.

Screenshots showing ANSI control sequences not being interpreted by Powershell

PowerShell itself does somehow support colours, just not the ANSI colour control sequences. I bet there's a library that handles such things.

rbsec commented

Fixed in the immediate term by just removing coloured output on Windows. As you say, I'm sure there's a way to get colour in PowerShell (and probably even CMD), but given you're the first person to ask about this in a few years, there doesn't seem to be too many people using it in CMD/PowerShell.

One for the todo list.

~rbsec

I am getting this error in Kali linux after this fix:-

Traceback (most recent call last):
File "./dnscan.py", line 123, in
class col:
File "./dnscan.py", line 124, in col
if sys.stdout.isatty() and platform.system() != "Windows":

So i have to undo the changes of this script to make it work.

rbsec commented

Whoops, fixed in the latest commit.

It is working fine now. :)