我一直在网上寻找如何解决此问题,但未成功。实际上,我已经有超过一年的时间了,只是忽略了它。既然我在Symfony 4.1项目中正在做更多关于ORM的工作,我想知道是否有人知道如何在Windows 10计算机上修复字体/颜色?
I have been looking online to see how to fix this, and have been unsuccessful. I've actually had this issue for over a year now and have simply just ignored it. Now that I'm doing more doctrine ORM stuff in my Symfony 4.1 project, I would like to know if anyone knows how to fix the font/colors on my Windows 10 machine?
命令行工具: * Powershell-不能正确显示颜色 *命令提示符-不能正确显示颜色 * Git CMD-不能正确显示颜色
Command Line tools: * Powershell - Doesn't show the colors correctly * Command Prompt - Doesn't show the colors correctly * Git CMD - Doesn't show the colors correctly
这是我制作或编辑实体时的CLI外观:
This is what my CLI looks like when i'm making or editing an entity:
E:\wamp\www\GasCruiter>php bin/console make:entity Class name of the entity to create or update (e.g. GentleChef): > UserConfirmation U[K7[30;47mser[39;49m8s[K7[30;47mer[39;49m8e[K7[30;47mr[39;49m8r[K78C[K7[30;47monfirmation[39;49m8o[K7[30;47mnfirmation[39;49m8n[K7[30;47mfirmation[39;49m8f[K7[30;47mirmation[39;49m8i[K7[30;47mrmation[39;49m8r[K7[30;47mmation[39;49m8m[K7[30;47mation[39;49m8a[K7[30;47mtion[39;49m8t[K7[30;47mion[39;49m8i[K7[30;47mon[39;49m8o[K7[30;47mn[39;49m8n[K78 Your entity already exists! So let's add some new fields! [32mNew property name (press [39m[32m<return>[39m[32m to stop adding fields)[39m: > date [32mField type (enter [39m[33m?[39m[32m to see all types)[39m [[33mstring[39m]: > datetime d[K7[30;47matetime[39;49m8a[K7[30;47mtetime[39;49m8t[K7[30;47metime[39;49m8e[K7[30;47mtime[39;49m8t[K7[30;47mime[39;49m8i[K7[30;47mme[39;49m8m[K7[30;47me[39;49m8e[K78 [32mCan this field be null in the database (nullable) (yes/no)[39m [[33mno[39m]: > no [32mupdated[39m: src/Entity/UserConfirmation.php [32mAdd another property? Enter the property name (or press [39m[32m<return>[39m[32m to stop adding fields)[39m: > [37;42m [39;49m [37;42m Success! [39;49m [37;42m [39;49m Next: When you're ready, create a migration with [33mmake:migration[39m我一定缺少某种系统字体吗?
I must be missing some sort of system font? Not exactly sure how to fix this.
推荐答案Powershell 和 CMD strong>终端/控制台模拟器支持颜色的ANSI转义码。
Neither the Powershell nor CMD terminals/console emulators support ANSI escape codes for colors.
这就是为什么您看到这些> strong> ANSI转义码 。您的终端不知道如何解释它们。
This is why you're seeing these ANSI escape codes. Your terminal just doesn't know how to interpret them.
虽然我个人有一段时间没有使用Windows,但我记得我对 ConEmu 。
While I personally haven't used windows for a while I remember that I had good experience with ConEmu. It's brings color support amongst other nice features.
要快速入门,您应该给 cmder -这是一个现成的控制台模拟器,具有基于ConEmu的漂亮配色方案。
For a quick start you should give cmder a shot - it's a ready-to-go console emulator with a nice color scheme built on top of ConEmu.
获得具有颜色支持的控制台模拟器的另一个快速选择是下载 CygWin 可以在Windows上为您提供与POSIX兼容的环境并使用,即包含的 xterm 端口。
Another quick option to get a console emulator with color support is to download CygWin which gives you a POSIX compatible environment on windows and use i.e. the included port of xterm.
此外,任何基于 symfony / console的工具接受-no-ansi 标志可禁止输出ANSII转义码。
Further any tool based on symfony/console accepts the --no-ansi flag to suppress output of ANSII escape codes.
无颜色输出的示例:
bin/console --no-ansi make:entity composer --no-ansi install更多推荐
Symfony Doctrine ORM CLI字体/颜色不起作用?
发布评论