jq icon indicating copy to clipboard operation
jq copied to clipboard

wip: feat: terminate jq immediately after the outgoing pipe closed

Open mumoshu opened this issue 7 years ago • 2 comments

This should work. In reality, this does compile, but doesn't function when I actually try to emit SIGPIPE by doing:

cat | ./jq . | bash -c 'sleep 1; foo'
bash: foo: command not found

My understanding is that the missing command foo should immediately result in SIGPIPE on the jq command, so that this feature terminates jq immediately.

I'd greatly appreciate it if anyone could share your insight on how I could make it actually work :pray:

Resolves #1691

mumoshu avatar Aug 03 '18 06:08 mumoshu

Coverage Status

Coverage decreased (-0.5%) to 84.48% when pulling da030b0c12e21cfd7bd4261dc2854b9992f21234 on mumoshu:quit-on-sigpipe into 90bc29c1b544c0436ec44246e180fdbb6d6384df on stedolan:master.

coveralls avatar Aug 03 '18 07:08 coveralls

See also commentary in #1285.

nicowilliams avatar Jul 07 '23 19:07 nicowilliams