tput: No value for $TERM and no -T specified in Sublime Text 3

喜夏-厌秋 提交于 2020-05-25 06:58:12

问题


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

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

EDIT

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

回答1:


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


来源:https://stackoverflow.com/questions/25515382/tput-no-value-for-term-and-no-t-specified-in-sublime-text-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!