PyCharm - django控制台中的彩色输出

时间:2022-06-02 18:18:13

The problem is that when I'm lauching dev-server through Kubuntu's Konsole app, debug output is colored: PyCharm  -  django控制台中的彩色输出

问题是,当我通过Kubuntu的Konsole应用程序推出dev-server时,调试输出是彩色的:

But wher I'm launching it trough built-in "Run" or "Debug" in PyCharm, the output in PyCharm's console is all red: PyCharm  -  django控制台中的彩色输出

但是我在PyCharm中通过内置的“Run”或“Debug”启动它,PyCharm控制台中的输出都是红色的:

Is there a way to make output in PyCharm colored? Because I can't find anything related in Settings.

有没有办法让PyCharm的输出变为彩色?因为我在“设置”中找不到任何相关内容。

UPD: link to issue on PyCharm issue tracker

UPD:链接到PyCharm问题跟踪器上的问题

As I see some people woting on this question, so here is the link to this issue on PyCharm issue tracker - youtrack.jetbrains.com/issue/PY-19790. If you will vote for this feature, it will be released faster!

正如我看到一些人对这个问题的看法,所以这里是PyCharm问题跟踪器上这个问题的链接 - youtrack.jetbrains.com/issue/PY-19790。如果您将投票支持此功能,它将更快发布!

1 个解决方案

#1


0  

This is because the development console for PyCharm is not using the same kind of standards to display colors as your normal shell terminal (they are two very different things).

这是因为PyCharm的开发控制台没有使用与普通shell终端相同的标准显示颜色(它们是两个非常不同的东西)。

The output console for PyCharm is just a display of commands (its not a full shell with all the bells and whistles of your local terminal emulator).

PyCharm的输出控制台只是一个命令显示(它不是一个完整的shell,带有你本地终端模拟器的所有铃声和口哨声)。

You can embed a terminal into PyCharm (see the documentation on how to set it up) but doing so will not allow you to redirect the output of the built-in run commands to the terminal window. It will enable you to run arbitrary shell commands there, and avoid having to switch over to a terminal console.

您可以将终端嵌入到PyCharm中(请参阅有关如何设置它的文档),但这样做不允许您将内置运行命令的输出重定向到终端窗口。它将使您能够在那里运行任意shell命令,并避免切换到终端控制台。

Keep in mind if you have any special shell customization or fonts/glyphs these may not appear correctly in the embedded terminal, because it is using a different set of fonts and configuration.

请记住,如果您有任何特殊的shell自定义或字体/字形,这些可能无法在嵌入式终端中正确显示,因为它使用的是一组不同的字体和配置。

You can try and raise this as an enhancement at the PyCharm bug tracker; if it gets enough votes it may make it in to the next release.

您可以尝试将其作为PyCharm bug跟踪器的增强功能进行提升;如果获得足够的票数,它可能会进入下一个版本。

#1


0  

This is because the development console for PyCharm is not using the same kind of standards to display colors as your normal shell terminal (they are two very different things).

这是因为PyCharm的开发控制台没有使用与普通shell终端相同的标准显示颜色(它们是两个非常不同的东西)。

The output console for PyCharm is just a display of commands (its not a full shell with all the bells and whistles of your local terminal emulator).

PyCharm的输出控制台只是一个命令显示(它不是一个完整的shell,带有你本地终端模拟器的所有铃声和口哨声)。

You can embed a terminal into PyCharm (see the documentation on how to set it up) but doing so will not allow you to redirect the output of the built-in run commands to the terminal window. It will enable you to run arbitrary shell commands there, and avoid having to switch over to a terminal console.

您可以将终端嵌入到PyCharm中(请参阅有关如何设置它的文档),但这样做不允许您将内置运行命令的输出重定向到终端窗口。它将使您能够在那里运行任意shell命令,并避免切换到终端控制台。

Keep in mind if you have any special shell customization or fonts/glyphs these may not appear correctly in the embedded terminal, because it is using a different set of fonts and configuration.

请记住,如果您有任何特殊的shell自定义或字体/字形,这些可能无法在嵌入式终端中正确显示,因为它使用的是一组不同的字体和配置。

You can try and raise this as an enhancement at the PyCharm bug tracker; if it gets enough votes it may make it in to the next release.

您可以尝试将其作为PyCharm bug跟踪器的增强功能进行提升;如果获得足够的票数,它可能会进入下一个版本。