【发布时间】:2018-11-28 01:01:53
【问题描述】:
上下文:
- 我正在尝试在 WSL 上设置 Powerline
- 在我的 Windows 机器上
- 我已将其设置为 Intellij 中的终端,该终端在 windows 上运行
颜色以一种非常奇怪的方式显示。我遇到了How to change the output color of echo in Linux 的问题,它建议使用以下命令来测试颜色输出。
for code in {0..255}; do echo -e "\033[48;5;${code}m $code "; done | paste - - - - - - - -
我在尝试使用 WSL bash 终端时得到了类似的结果。
编辑:这只发生在 intellij 中。 bash.exe 和 ubuntu 终端没有这个问题。
在 intellij/WSL 中使用 8 位和/或 24 位颜色的正确方法是什么?
【问题讨论】:
-
从我的实验来看,终端似乎认为它使用的是 8 位颜色,但 Intellij 正在将它的输出转换回可以在设置中调整的主要 ANSI 颜色。
-
我没听错,在 Windows 上运行 WSL 会显示正确的颜色,但是当您在 IDE 中将其设置为终端时颜色是错误的?
-
是的。当我将终端设置为“bash.exe”而不是“cmd.exe”时,bash 窗口以有限的颜色显示,如上所示,但如果我在 Intellij 之外打开 bash.exe,它将具有 8 的完整范围-位颜色。
标签: intellij-idea windows-subsystem-for-linux