nichtich / wdq

Command line interface to Wikidata Query Service
https://metacpan.org/pod/distribution/App-wdq/script/wdq
Other
54 stars 4 forks source link

support wdq colors in microsoft terminal #31

Open VladimirAlexiev opened 4 years ago

VladimirAlexiev commented 4 years ago

Microsoft Terminal now supports VT escape sequences.

VladimirAlexiev commented 4 years ago

MS gave this advice in microsoft/terminal#3432 :

In order for escape sequences to work in the Windows Console (conhost.exe, the vintage terminal on Windows), applications need to explicitly call SetConsoleMode with ENABLE_VIRTUAL_TERMINAL_PROCESSING. So perhaps something in the stack here isn't calling that?

For the record, installing wdq in WSL does correctly display the colors. This is because WSL itself is setting the console into the correct mode for all child processes it launches.

I've asked what is WSL and how do I install wdq into it.

Given that cygwin cat shows the colors, it's puzzling why wdq doesn't show them. @nichtich any advice?

VladimirAlexiev commented 4 years ago

The color works fine in ConEmu so I'll use this as a workaround

VladimirAlexiev commented 3 years ago

@nichtich wdtaxonomy shows the colors ok. What console output library do you use in the two cases, and can you switch wdq to use the same as wdtaxonomy?

image