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

后端 未结 13 1908
忘了有多久
忘了有多久 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:31

    I found this tool to be working for my end. Microsoft Color Tool from GitHub

    Unzip the compressed file then open CMD with Administration permission.

    Go to the folder where you unzip the file in CMD.

    Then execute this command "colortool -b scheme-name"

    The scheme-name needs to be replaced with any of these options below:

    • campbell.ini
    • campbell-legacy.ini
    • cmd-legacy.ini
    • deuternopia.itermcolors
    • OneHalfDark.itermcolors
    • OneHalfLight.itermcolors
    • solarized_dark.itermcolors
    • solarized_light.itermcolors

    In my case, the command would be like this "colortool -b solarized_dark.itermcolors"

    Click right on the console window and select Properties.

    You don't need to change any value just click "OK" to save the setting. (You will notice that your font already contains colors).

    Console Property

    Then restart your cmd or powerShell.

    The ANSI color should be enabled and working with the color scheme you chose before.

提交回复
热议问题