dbg-macro icon indicating copy to clipboard operation
dbg-macro copied to clipboard

Colorized output support for Windows.

Open gwankyun opened this issue 4 years ago • 12 comments

  1. Use SetConsoleTextAttribute to support Colorized output on Windows.
  2. Must set NOMINMAX when use std::min on Windows.
  3. __cplusplus is not enough to check MSVC standard.

gwankyun avatar Nov 25 '20 16:11 gwankyun

Thank you very much for your contribution!

Happy to take a look when the builds are green.

sharkdp avatar Dec 01 '20 18:12 sharkdp

I have updated our CI system to GitHub Actions, see #104. It would be great if you could rebase your branch to run the new set of tests.

sharkdp avatar Dec 31 '20 09:12 sharkdp

The checks have passed, Please review it.^_^

gwankyun avatar Jan 14 '21 12:01 gwankyun

I learning to solve #97 .

gwankyun avatar Feb 03 '21 16:02 gwankyun

Thank you for your contribution. A few things are included here. It would be great if we could split them into separate PRs. As for part 2 (Must set NOMINMAX when use std::min on Windows.), have you seen https://github.com/sharkdp/dbg-macro/pull/100?

As for the main change here (colorized support for Windows): I would prefer if we could keep the complexity somewhat limited and only support ANSI-escape sequence based terminals. This should work just fine on Windows 10, if the support is enabled (https://docs.microsoft.com/de-de/windows/console/console-virtual-terminal-sequences).

sharkdp avatar Feb 13 '21 19:02 sharkdp

I defined a DBG_ANSI_TYPE marco in dbg.h, for optional support Classic Console API on Windows 7 in example.cpp.

gwankyun avatar Feb 26 '21 17:02 gwankyun

cc @sharkdp

bl-ue avatar Apr 07 '21 22:04 bl-ue

cc @sharkdp

?

sharkdp avatar Apr 13 '21 13:04 sharkdp

Sorry, that wasn't very clear. 😄

I was using my own macro on a project, but I recently came upon this library, which I immediately preferred and attempted to use, but I found that it doesn't support the platform I'm developing for, Windows. I can easily checkout this PR, but I'd love to see it merged into master (which maybe should be renamed to main?)

bl-ue avatar Apr 14 '21 20:04 bl-ue

To be honest, I have lost track of what this PR does. There are a lot of changes, especially to the CMake config. As I said above: I'm happy to integrate this, but only for terminals that support ANSI escape sequences. I don't want to add (and maintain) a lot of code for legacy Windows terminals.

sharkdp avatar Aug 08 '21 08:08 sharkdp

Must set NOMINMAX when use std::min on Windows.

just wrap it in parenthesis =)

(std::min)(...)

niXman avatar Jan 16 '23 21:01 niXman

Must set NOMINMAX when use std::min on Windows.

just wrap it in parenthesis =)

(std::min)(...)

Thank you but >_<

gwankyun avatar Feb 20 '23 15:02 gwankyun