Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

No output with -f when run in background after 1.6.6 #23

Closed
a-j-wood opened this issue May 29, 2022 · 1 comment
Closed

No output with -f when run in background after 1.6.6 #23

a-j-wood opened this issue May 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@a-j-wood
Copy link
Owner

a-j-wood commented May 29, 2022

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

Thanks

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 [1] 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.

Thanks!

[1] https://github.com/gray/app-runstoprun

@a-j-wood a-j-wood added the bug Something isn't working label May 29, 2022
@a-j-wood
Copy link
Owner Author

Hello @gray

The "--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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant