0

If I write a script in BBEdit/TextWrangler, e.g.

#!/usr/bin/env python
print 1234

and choose "Run" from the #! menu, I get this in a new document:

1234
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

How do I get rid of those 3 extra lines?

  • Change your shell init so that it's smart enough to know whether the shell that's being started is interactive or not, and not do whatever it's doing if it isn't. – Marc Wilson Nov 26 '18 at 23:36
1

The solution is to enclose any use of tput in .bash_profile within a test for interactive shell, i.e.:

if [[ $- == *i* ]]; then
  #tput command
  #tput command
  #tput command
  #etc
fi

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .