英文:
how to set gcc output colors for msys2 installation running on windows terminal?
问题
I've just updated gcc to 13.1 (ucrt version) from the msys2 distribution on windows 10; I use it on the old windows terminal. While compiling I've realized that it gives some hardly distinguishable color in part of the error message (a dark purple on black background). Changing the background color in the terminal doesn't solve, because gcc forces somehow the background color of its output lines to black.
I've seen on this post: https://stackoverflow.com/questions/5732562/improving-g-output that I can set the colors with the GCC_COLORS variable. But how do I set it from my environment (windows terminal with gcc 13.1 from msys2)?
I've also tried with a command like this in the windows terminal:
setx GCC_COLORS "error=01;30:warning=01;34:note=01;33:caret=01;31:locus=01:quote=01"
but it doesn't seem to affect gcc's output.
Please note that:
- I don't want to use clang; this question is about gcc
- I don't want to use powershell; this question is about windows terminal
- I have windows 10, not 11
- I also use linux and compile on it too, but for this question I'm interested in the windows environment.
英文:
I've just updated gcc to 13.1 (ucrt version) from the msys2 distribution on windows 10; I use it on the old windows terminal. While compiling I've realized that it gives some hardly distinguishable color in part of the error message (a dark purple on black background). Changing the background color in the terminal doesn't solve, because gcc forces somehow the background color of its output lines to black.
I've seen on this post :
https://stackoverflow.com/questions/5732562/improving-g-output
that I can set the colors with the GCC_COLORS variable. But how do I set it from my environment (windows terminal with gcc 13.1 from msys2) ?
I've also tried with a command like this in the windows terminal:
setx GCC_COLORS "error=01;30:warning=01;34:note=01;33:caret=01;31:locus=01:quote=01"
but it doesn't seem to affect gcc's output.
Please note that:
-
I don't want to use clang; this question is about gcc
-
I don't want to use powershell; this question is about windows terminal
-
I have windows 10, not 11
-
I also use linux and compile on it too, but for this question I'm interested in the windows environment.
答案1
得分: 1
我可能会在终端设置中选择一个不同的配色方案。看起来默认的“深洋红色底黑色字”对比度不太好。内置的“一半深色”方案看起来好一些。
或者,如果你想真正自定义外观,可以在 https://github.com/mbadolato/iTerm2-Color-Schemes 找到很多好的配色方案。
英文:
I'd probably just pick a different color scheme in the Terminal settings. Looks like the default "dark magenta on black" contrast just isn't all that good. The built-in "One Half Dark" scheme looks a bit better.
Or if you want to really customize the look, there are TONS of good schemes over at https://github.com/mbadolato/iTerm2-Color-Schemes
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论