Intellij 终端中的 ANSI 颜色

ANSI Colors in Intellij Terminal

上下文:

颜色以一种非常奇怪的方式显示。我遇到了问题 How to change the output color of echo in Linux,它建议使用以下命令来测试颜色输出。

for code in {0..255}; do echo -e "3[48;5;${code}m $code "; done | paste - - - - - - - -

结果如下。

我在尝试使用 WSL bash 终端时得到了类似的结果。 编辑: 这只发生在 intellij 中。 bash.exe 和 ubuntu 终端没有这个问题。

在 intellij/WSL 中使用 8 位 and/or 24 位颜色的正确方法是什么?

自 Intellij Idea 版本 2021.3 起,由于 Windows 上的 ConPTY 支持,终端现在支持 24 位颜色。