tput:崇高文字3中没有$ TERM值,也没有指定-T [英] tput: No value for $TERM and no -T specified in Sublime Text 3

查看:58
本文介绍了tput:崇高文字3中没有$ TERM值,也没有指定-T的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用Sublime Text 3(无论语言如何)构建任何内容时,在任何控制台输出的开头都会得到以下几行:

When I build anything in Sublime Text 3 (regardless of language), I get the following lines at the beginning of any console output:

tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified

我不知道ST3正在使用什么外壳程序设置或如何编辑它们.我该如何摆脱呢?

I have no idea what shell settings ST3 is using or how to edit them. How do I get rid of this?

编辑

以下是我的〜/.bash_profile 的内容,其中给出了注释,可能需要进行一些

Here are the contents of my ~/.bash_profile, which given the comments, probably need some editing:

# Prompt
NRM=`tput sgr0`
BLD=`tput bold`
ITL=`tput sitm`
UL=`tput smul`
RED=`tput setaf 1`
GRN=`tput setaf 2`
BLU=`tput setaf 4`

PS1='\n\r${BLD}\u${NRM}|${UL}\h${NRM} [${BLD}${BLU}\W${NRM}] \w \n>> '

# For Homebrew
export PATH=/usr/local/bin:$PATH

推荐答案

必须更改 .bash_profile 以便在处理任何 tput 调用之前检查交互式shell:

Have to change .bash_profile to check for interactive shell before processing any tput calls:

if [[ $- == *i* ]]
then
    # Prompt
    NRM=`tput sgr0`
    BLD=`tput bold`
    ITL=`tput sitm`
    UL=`tput smul`
    RED=`tput setaf 1`
    GRN=`tput setaf 2`
    BLU=`tput setaf 4`
    PS1='\n\r${BLD}\u${NRM}|${UL}\h${NRM} [${BLD}${BLU}\W${NRM}] \w \n>> '
fi

这篇关于tput:崇高文字3中没有$ TERM值,也没有指定-T的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆