? includes/table.inc
Index: drush
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/drush,v
retrieving revision 1.24
diff -u -p -r1.24 drush
--- drush	8 Nov 2010 13:22:42 -0000	1.24
+++ drush	9 Nov 2010 19:59:44 -0000
@@ -28,15 +28,15 @@ case $(uname -a) in
     SCRIPT_PATH=$(cygpath -w -a -- "$SCRIPT_PATH") ;;
 esac
 
-# prepend "--nocolor" to the argument list if stdout is not a terminal
-if [ ! -t 1 ]; then
-  set -- "--nocolor" ${1+"$@"}
-fi
-
 # If not exported, try to determine and export the number of columns.
-if [ -z $COLUMNS ]; then
+# We do not want to run $(tput cols) if $TERM is empty or "dumb", because
+# if we do, tput will output an undesirable error message to stderr.  If
+# we redirect stderr in any way, e.g. $(tput cols 2>/dev/null), then the
+# error message is suppressed, but tput cols becomes confused about the
+# terminal and prints out the default value (80).
+if [ -z $COLUMNS ] && [ -n "$TERM" ] && [ "$TERM" != dumb ] ; then
   # Note to cygwin users: install the ncurses package to get tput command.
-  if COLUMNS=$(tput cols 2>/dev/null); then
+  if COLUMNS=$(tput cols); then
     export COLUMNS
   fi
 fi
Index: includes/environment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/environment.inc,v
retrieving revision 1.99
diff -u -p -r1.99 environment.inc
--- includes/environment.inc	9 Nov 2010 11:35:34 -0000	1.99
+++ includes/environment.inc	9 Nov 2010 19:59:45 -0000
@@ -569,9 +569,11 @@ function _drush_bootstrap_global_options
 
   // Suppress colored logging if --nocolor option is explicitly given or if
   // terminal does not support it.
-  $nocolor = (drush_get_option(array('nocolor'), FALSE) || !getenv('TERM'));
+  $nocolor = (drush_get_option(array('nocolor'), FALSE));
   if (!$nocolor) {
-    // Check for colorless terminal.
+    // Check for colorless terminal.  If there is no terminal, then
+    // 'tput colors 2>&1' will return "tput: No value for $TERM and no -T specified",
+    // which is not numeric and therefore will put us in no-color mode.
     $colors = exec('tput colors 2>&1');
     $nocolor = !($colors === FALSE || (is_numeric($colors) && $colors >= 3));
   }
