问题
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