No output with -f when run in background after 1.6.6 #23
Summary of correspondence:
On 5/29/22 07:06, Andrew Wood wrote:
Hello, thanks for your email.
I agree that "-f" should probably do what it says - force output - but
it gets complicated when writing to a terminal since writing to a terminal
when you're not the controlling process will generate a SIGTTOU which causes
it to stop.
Just to confirm, you are saying that with "-f" on 1.6.6, output is written
to stderr even when pv is in the background and stderr is a terminal, but in
newer versions no output is written in those circumstances?
Yes, that is correct. But more importantly, in 1.6.6 this case also
works without even needing "-f".
BTW, I added some options to my tool to work around this new behavior,
so it no longer affects me:
-G --no-group Don't create a new process group or determine PGIDs
-T, --no-tty Disable pseudo-terminal allocation
Date: Sat, Apr 30, 2022 at 07:51:41PM +0000
Sent from: gray
Hi, I have a small issue with pv. I've been happily using it together with my own tool, but I recently added some features to my tool which made pv stop talking to me :-) I just made my tool public  and I see from your github page you're familiar with Perl, so I'll use my tool in the example. Let me know if you need a more minimal test case.
(#) this works as expected and prints a summary:
$ yes y | pv -pterl > /dev/null
(#) this will NOT print anything
$ yes y | run-stop-run pv -fpterl > /dev/null
I have tested against pv installed via MacPorts as well as direct from source. The manpage states the force options will output even if STDERR is not a terminal. But it doesn't mention that it won't output if it IS a terminal, but pv isn't the foreground process. Would it be possible to add an option (maybe really force -ff) that would make pv output if it's in the background and connected to stderr?
I modified pv_in_foreground() and it works fine for me when using pseudo-terminals (run-stop-run -t). Hmm, I just tested version 1.6.6 , and the default behavior does exactly what I want without even needing -f.
--force" option wasn't really working properly at all. The latest code in git (which will be in the next release after 1.6.20) should correct this.
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?