How to make win32 console recognize ANSI/VT100 escape sequences?

后端 未结 13 1587
忘了有多久
忘了有多久 2020-11-22 03:47

I\'m building a lightweight version of the ncurses library. So far, it works pretty well with VT100-compatible terminals, but win32 console fails to recognise the \\03

13条回答
  •  长情又很酷
    2020-11-22 04:21

    If ANSICON is not acceptable since it requires you to install something on the system, a more lightweight solution that parses and translates the ANSI codes into the relevant Win32 API console functions such as SetConsoleTextAttribute.

    https://github.com/mattn/ansicolor-w32.c

提交回复
热议问题