How to correctly enable ANSI colors in ConEmu + Git Bash?

前端 未结 3 859
天涯浪人
天涯浪人 2021-01-02 09:08

I\'m using Git Bash with ConEmu to make it look cool. However, upon installing Composer the colors seem to be escaped:

3条回答
  •  鱼传尺愫
    2021-01-02 09:43

    Another problem you may encounter is if you set up the task (Settings → Startup → Tasks) without proper quoting. Having a task like the following will break ANSI coloring of composer (everything else seems to work just fine):

    %TOOLS_DIR%\git\bin\sh.exe --login -i -new_console:C:%TOOLS_DIR%\git\mingw64\share\git\git-for-windows.ico:t:"Git bash"
    

    The value of %TOOLS_DIR% is D:\Tools. I can only imagine that the backslashes are the problem. however, the following works as expected:

    "%TOOLS_DIR%\git\bin\sh.exe" --login -i -new_console:C:"%TOOLS_DIR%\git\mingw64\share\git\git-for-windows.ico":t:"Git bash"
    

提交回复
热议问题