如何在 DDEV 中设置终端颜色?

问题描述 投票:0回答:1

当我这样做时

ddev ssh
都是黑色文本。如何显示标准终端颜色?

ddev
1个回答
0
投票

在 DDEV 文件夹 .ddev/homeadditions/ 中创建 .bash_aliases

添加以下文字:

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi

运行

ddev restart
,DDEV 会在启动环境时将其添加到您的 bash 配置中。

© www.soinside.com 2019 - 2024. All rights reserved.