From d3a636f2a53a6e84b95a5be6f186d6bb79e87c63 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 24 May 2002 07:53:18 -0700 Subject: [PATCH] [svn] Fall back to dot progress if the terminal type is "emacs". Published in . --- src/ChangeLog | 5 +++++ src/progress.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 22fd418d..98408664 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-05-24 Hrvoje Niksic + + * progress.c (bar_set_params): Fall back to dot progress if the + terminal type is "emacs". + 2002-05-20 Hrvoje Niksic * log.c: Don't #undef WGET_USE_STDARG. diff --git a/src/progress.c b/src/progress.c index b5b7c382..0288355d 100644 --- a/src/progress.c +++ b/src/progress.c @@ -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) { -- 2.39.2