]> sjero.net Git - wget/commitdiff
[svn] Fall back to dot progress if the terminal type is "emacs".
authorhniksic <devnull@localhost>
Fri, 24 May 2002 14:53:18 +0000 (07:53 -0700)
committerhniksic <devnull@localhost>
Fri, 24 May 2002 14:53:18 +0000 (07:53 -0700)
Published in <sxsd6vllhsi.fsf@florida.munich.redhat.com>.

src/ChangeLog
src/progress.c

index 22fd418dba172bed753b3a3328463d9722989451..98408664863d1786b64e2f206cd41429ee77314a 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-24  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * progress.c (bar_set_params): Fall back to dot progress if the
+       terminal type is "emacs".
+
 2002-05-20  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * log.c: Don't #undef WGET_USE_STDARG.
index b5b7c3824c6c0cda7af299a64ee9856c7f31f368..0288355d58efdf4fd151c6f27c6cdbf9b3ba2c3d 100644 (file)
@@ -801,6 +801,7 @@ static void
 bar_set_params (const char *params)
 {
   int sw;
+  char *term = getenv ("TERM");
 
   if (params
       && 0 == strcmp (params, "force"))
@@ -808,10 +809,19 @@ bar_set_params (const char *params)
 
   if ((opt.lfilename
 #ifdef HAVE_ISATTY
+       /* The progress bar doesn't make sense if the output is not a
+         TTY -- when logging to file, it is better to review the
+         dots.  */
        || !isatty (fileno (stderr))
 #else
        1
 #endif
+       /* Normally we don't depend on terminal type because the
+         progress bar only uses ^M to move the cursor to the
+         beginning of line, which works even on dumb terminals.  But
+         Jamie Zawinski reports that ^M and ^H tricks don't work in
+         Emacs shell buffers, and only make a mess.  */
+       || (term && 0 == strcmp (term, "emacs"))
        )
       && !current_impl_locked)
     {