How to show colored console output in Clion

梦想与她 提交于 2019-12-10 14:34:26

问题


I am trying to write a C++ application with Clion that makes use of colored console output using ASCII sequences. When I run the program in Clion, the colors are not shown. But when I run the program in my terminal, then I can see the colors.

Is there a hidden option I have to enable for this to work?

EDIT: I meant ANSI


回答1:


CLion's console is not a terminal (at least yet), but nothings prevents from interpreting the control codes related to color and highlight the text accordingly. This is exactly what happens when you trigger a CMake build, for example.

Unfortunately, this has not been implemented for launching the applications themselves. Feature request is here: https://youtrack.jetbrains.com/issue/CPP-2471



来源:https://stackoverflow.com/questions/32742850/how-to-show-colored-console-output-in-clion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!