[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded
From: |
Christian Neukirchen |
Subject: |
Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded |
Date: |
Mon, 21 Sep 2015 19:41:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Darshit Shah <address@hidden> writes:
> This patch has a couple of deficiencies that need to be addressed.
>
> 1. The point of the --show-progress switch is to override all other
> settings and display a progress bar on screen. This patch does not
> take into consideration the --show-progress switch.
True, I did not know about that switch. The condition is easily adjusted.
> 2. After this patch, Wget will *never* display a progress bar if it is
> invoked from a shell script / another C program. This not only changes
> the default behaviour, it is also not something we want. Running the
> Perl / Python tests singularly will display this effect. With this
> patch in the next release, there will be way too many people
> complaining about a missing progress bar.
>
> From `man tcgetpgrp`:
>
> The function tcgetpgrp() returns the process group ID of the
> foreground process group on the terminal associated to fd, which must
> be the controlling terminal of the calling process.
>
> But, when wget is invoked from within a shell script, its pid != ppid
> This causes progress bar to disappear.
Indeed. A better test is getpgid(0) == tcgetpgrp(2). This seems to
work for interactive shells and scripts as well (backgrounding the
script will turn off the progress-bar).
> If someone wants to background a Wget process, let them use SIGHUP to handle
> it.
The problem is that one cannot easily foreground it then again,
because the input stays in the file. Also, from a user-experience
point of view, this is clumsy.
> There is also Giuseppe's response on the mailing list which is present
> in the links provided by Noel Koethe. We should not change the default
> behaviour of Wget. Especially one which helps identify a very common
> mistake by many people.
The other output of wget is still printed, so this mistake will be
noticed.
> Since the patch in its current form causes more problems than it
> solves, I'm reverting it right now. We can discuss an alternative
> strategy here and if it works, a new patch can be applied later.
Please try above proposal.
Thanks,
--
Christian Neukirchen <address@hidden> http://chneukirchen.org
- [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Christian Neukirchen, 2015/09/08
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Ander Juaristi, 2015/09/08
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Tim Ruehsen, 2015/09/09
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Tim Ruehsen, 2015/09/10
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Darshit Shah, 2015/09/21
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded,
Christian Neukirchen <=
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Tim Ruehsen, 2015/09/22
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Gisle Vanem, 2015/09/22
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Tim Ruehsen, 2015/09/22
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Jernej Simončič, 2015/09/22
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Ángel González, 2015/09/22
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Gisle Vanem, 2015/09/23
- Re: [Bug-wget] Feature: Disabling progress bar when wget is backgrounded, Darshit Shah, 2015/09/22