bluenote10 / yachalk

🖍️ Terminal string styling done right
MIT License
161 stars 3 forks source link

Windows 10 Command Prompt support? #9

Open bfailing opened 2 years ago

bfailing commented 2 years ago

It doesn't work in Windows 10 Command Prompt without first adding the following:

import os
os.system('')

Is that the expected behavior? If so, can something like the above be added to the library?

bluenote10 commented 2 years ago

Unfortunately, I have no experience with Windows. Basically all that is needed is a terminal with standard ANSI escape code support. I had also noticed this hint in the original chalk documentation. It is quite weird though that running an empty os.system (what is that launching actually?) can have such a side effect. I'm afraid I can be of much help in this case, because I don't have access to Windows, and this sounds like an idiosyncrasy of that terminal.

eabase commented 2 years ago

Yeah, this is a really wicked thing, that can't be explained without diving into the source code of that (Windows) python library. You can look at some related technical discussion about UTF-8 with and without BOM, and how it affects the Powershell's [native vs Core] differently and does weird stuff to the terminal, depending...

See: