php orm mateor,Symfony Doctrine ORM CLI Font/Colors not working?

问题

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?

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

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[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[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.

回答1:

Neither the Powershell nor CMD terminals/console emulators support ANSI escape codes for colors.

This is why you're seeing these ANSI escape codes. Your terminal just doesn't know how to interpret them.

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.

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.

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.

Further any tool based on symfony/console accepts the --no-ansi flag to suppress output of ANSII escape codes.

Examples without color output:

bin/console --no-ansi make:entity

composer --no-ansi install

来源:https://stackoverflow.com/questions/53220153/symfony-doctrine-orm-cli-font-colors-not-working

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值