問(wèn)題
在windows 10上使用 git bash,在php的laravel項(xiàng)目目錄下運(yùn)行php artisan list出現(xiàn)如下亂碼:
Laravel Framework ?[32m6.2.0?[39m
?[33mUsage:?[39m
command [options] [arguments]
?[33mOptions:?[39m
?[32m-h, --help?[39m Display this help message
?[32m-q, --quiet?[39m Do not output any message
?[32m-V, --version?[39m Display this application version
?[32m --ansi?[39m Force ANSI output
?[32m --no-ansi?[39m Disable ANSI output
?[32m-n, --no-interaction?[39m Do not ask any interactive question
?[32m --env[=ENV]?[39m The environment the command should run under
?[32m-v|vv|vvv, --verbose?[39m Increase the verbosity of messages: 1 for norm
al output, 2 for more verbose output and 3 for debug
在英文網(wǎng)站找到了解決的辦法:
在git 的 .bashrc 文件加入如下內(nèi)容:
##### Git Bash for Windows >= 2.x
# remove the winpty PHP aliases
unalias $(alias | grep winpty | grep php | cut -d"=" -f1 | cut -d" " -f2)
# support ansi color
export ANSICON=true
相關(guān)連接:https://blog.kmelia.net/testing/coloration-dans-git-bash/123