2017-10-16 87 views
1

我遇到使用PhpStorm控制台的问题:它不支持ANSI颜色。PhpStorm控制台不支持ANSI颜色

任何建议可以帮助我吗?

控制台这个样子的

myconsole

+0

是否在独立的终端应用程序正常工作? –

+0

@VladLuchansky是我在git bash中测试过它看起来是一样的 – mehran

+0

好吧,如果它对于独立bash是相同的,那么你需要检查它的配置。 PhpStorm只是简单地包装一个终端应用程序,没有什么关于渲染文本或颜色的。 –

回答

1

,你可以在你的.bashrc文件中使用此脚本进行彩色化提示:

# Customize Bash settings. 
cat <<EOF > /home/vagrant/.bashrc 
# Colorize the prompt. 
yellow=\$(tput setaf 3) 
green=\$(tput setaf 2) 
blue=\$(tput setaf 104) 
bold=\$(tput bold) 
reset=\$(tput sgr0) 

PS1="\[\$yellow\]\u\[\$reset\]@\[\$green\]\h\[\$reset\]:\[\$blue\$bold\]\w\[\$reset\]\$ " 

# Don't put duplicate lines or lines starting with space in the history. 
# See bash(1) for more options. 
export HISTCONTROL=ignoreboth 

# Append to the history file, don't overwrite it. 
shopt -s histappend 

# History size up to 1000 commands. 
export HISTSIZE=1000 

# Make less more friendly for non-text input files, see lesspipe(1). 
[ -x /usr/bin/lesspipe ] && eval "\$(SHELL=/bin/sh lesspipe)" 

# Enable color support of ls and also add handy aliases. 
export CLICOLOR=1 
export LSCOLORS=ExFxCxDxBxegedabagacad 
if [ -x /usr/bin/dircolors ]; then 
    test -r ~/.dircolors && eval "\$(dircolors -b ~/.dircolors)" || eval "\$(dircolors -b)" 
    alias ls='ls --color=auto' 
    alias grep='grep --color=auto' 
    alias fgrep='fgrep --color=auto' 
    alias egrep='egrep --color=auto' 
fi 

# Enable programmable completion features (you don't need to enable 
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile 
# sources /etc/bash.bashrc). 
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then 
    . /etc/bash_completion 
fi 

# Set your favorite editor here. 
VISUAL=vim; export VISUAL 
EDITOR=vim; export EDITOR 

# Append /usr/local/bin to the path. 
export PATH=/usr/local/bin:/usr/local/share/python/:\$PATH 
EOF 
+0

即时通讯恐惧这不会帮助我添加到该文件,但它不会php的工匠comands颜色它显示数字 – mehran